Original Post
Hi,
I have a little problem. Here''s what I have
class obj
class A
{
Obj obj;
...
}
class B : public A
{
void B::test()
{
}
}
I want to set in the obj of the class A a pointer to a function
of class B.
How can I do that?
If I define in obj: void (B::*fp)();
then ok it works: I have a pointer to a function of class B
But how can I do that so it fits to any of the derived class of A ?
If I have class C : public A, how can I set the same pointer to a function of obj to point to a function of C ?
I hope I made myself clear enough :-)
Thanks
