pointers to class functions?
errhh...
is it possible to make a pointer that can contain a pointer to function inside a class not yet defined?
like:
Code:
struct Linked{
void (*pt2member)();
Linked *next;
}
class MyClass{
Linked *root;
void myFunct();
MyClass();
}
MyClass::MyClass()
{
root = new Linked;
root->pt2member=(*this.*myFunct)();
}
obviously the above don't work and I kinda assume you can't get this to work this way. I guess you get the pictuer: for it to work I have to set the void (*pt2member)(); to void (myClass::*pt2member)(); but (I suspect) since myClass isn't defined before the Linked...yeah well.
I just want to be assured this style doesn't work before moving on...
but then again maybe it can work...?)
I guess the question really is: do you have to declare the pointer to a class's function to be a pointer to the functions of that class
or can you just use a regular functionpointer somehow?
like: void (*funct)(); can't point to a class's member function?
thanks a bunnnchhhhhh
/btq