hi.
i have a question about generic List.
i have already built a new class of generic list that its working welll..
as i know when i build generic list i need to send the adress of some functions like:compare copy delete and print.
when i tried to make another class that is defined like that:
class Robot
{
public:
Robot(int board,int x,int y);
~Robot();
int Getx() { return m_x; }
void Setx(int val) { m_x = val; }
int Gety() { return m_y; }
void Sety(int val) { m_y = val; }
//addlocation;
private:
int m_board;
int m_x;
int m_y;
Linkedlist locList(Rcmp,Rcpy,Rprnt,Rdst);//the list and her functions
};
i get the error nit a type..
but if i will make a list on my main its working well?
how can i fixed it?
You aren't allow to initialize the attribute when you declare a class.
If you want do initialize your 'locList' you have to do it in the constructor of your class 'Robot'.