Original Post
Here''s a simplified version of what I am trying to do:
typedef void (*voidFunction) ();
class A
{public:
void functionA(){}
};
class B
{public:
voidFunction functionPointer;
void setFunction(voidFunction functionToSetTo)
{
functionPointer = functionToSetTo;
}
};
int main()
{
A classA;
B classB;
classB.setFunction(&(classA.functionA));
}
The error I get is: ''&'' : illegal operation on bound member function expression. Pretty much, I have a function pointer in class A and I want it to point to the function in class B. I have gotten classes (A in this case) to be able to point to functions not contained in a class, but how do I get it to point to a function inside of a class (B in this case). Thanks for any help.
--Vic--