hi i am a student and i am learning programming
last semester i have learned c and now we learn c++;
well my question is;
lets say i have i generic class linkedlist;
and i need to send pointers to the functions.
the class name is Linkedlist
so i have wrote the argument like that
Linkedlist(Cmp cmp,Cpy cpy,Prnt prnt,Dst dst)(compare copy print and destroy functions)
i have another class that her name is Board;
and i defined the functions in the class and i like to send pointers the linked llist so like that i can create the list
here is the headers of the classes
class Board
{
public:
Board(int x=15,int y=15);
~Board();
int Getx() { return m_x; }
void Setx(int val) { m_x = val; }
int Gety() { return m_y; }
void Sety(int val) { m_y = val; }
Elm cpy(Elm elm);
int cmp(Elm elm1,Elm elm2){return 0;}
void dst(Elm elm){delete ((Board*)elm);return;}
i wchanged it to Board a;
but there is still a problem.
i like to send the adress of the functions cmp cpy dst prnt that are in my Board class to the linkedlist class
what should i write?