ok guys we,ve got a class named array with this definition
template<class t>
class array
{
private:
t*list//array with different kind of types (int , float , double , other
//define class for instance class mylist,...)
public:
array();
void show();
}
int main()
{
array<int>a;
array<double>b;
array<mylist>c//my program was not built ,mylist is arbitrary (ideal)&i
//define it whit this shape:
//class mylist
//{
//int y;
//public:
//void show();
//}
return 0;
and now this is my question how do i can define a list of mylist class
}
we have a class with array name and it could store any object that we can have an array from each type of object for example an array with int or double type or an array of class objectives such as mylist--> (an ideal class) so we must compliment this class (array) with template
and this is a guidance from teacher
(you can use a variable of pointer type in the private of the class and name it list and in constructor define memory for the pointer)
the question we know we can define array class with ideal object and it could take the list pointer with for example int type but we need to define this pointer that it has this ability to take every type and this is the type i want an ideal class (mylist)
just how to define this pointer