Template C++

Written by  on March 29, 2018 

helle everyone
im beginner in c++ ,im learning template can you help me i cant found the error in this program
// file Tableau.h
template<class Tdonnee>
class Tableau {
Tdonnee* tab;
int taille;

public:
Tableau(Tdonnee init ,int size);
…..
//file Tableau.cpp
template<class Tdonnee> Tableau<Tdonnee> ::Tableau( Tdonnee init,int size) {
tab = new Tdonnee[size];
taille = size;
for(int i = 0 ; i<size ; i++)
{
tab = init ;
}
}
//main.cpp
int…

Template C++

Category : Uncategorized

Leave a Reply

Your email address will not be published. Required fields are marked *