Original Post
I'm having a little trouble with pointers to member functions.
I have this class with two member functions and a data member which is a pointer to a function like this:
[edited by - SpaceRogue on May 22, 2003 1:11:19 PM]
class Thingie
{
public:
bool (Thingie::*funcpointer)();
bool funcA();
bool funcB();
Thingie();
virtual ~Thingie();
};
I know I've set funcpointer=funcA successfully as debugging reveals the correct address is stored in funcpointer, but I can't seem to call the function from outside the class using something like:
Thingie A; (A.*funcpointer)();That will not compile, giving me an error that funcpointer is an undeclared identifier. If I change it to:
(A.funcpointer)();or
*(A.funcpointer)();I get an error that the expression does not evaluate to a function. What am I doing wrong here?