I have a C++ function pointer in a class ClassA:
void (ClassA::*funcPntr1)(void);
pointing to function:
void func();
by using assignment:
functPntr1 = &ClassA::func;
Now, i have another function pointer:
void (ClassA::*funcPntr2)(void);
I want funcPntr2 to point to the the function pointed by the funcPntr1. How do i do that?
I have tried this:
funcPntr2 = &(this->*funcPntr); //normally, i invoke the function pointer by (this->*funcPntr)()
But is wrong. I have tried many logical combinations, but doesn't seem to work.
funcPntr2 = funcPntr;?