array of function pointers in a class
I have a class member for which I'm trying to create a function pointer that will be stored in an array [of function pointers].
Given this example:
Code:
void CMyClass::MyFunction1(int32 param1, int32 param2){
...
}
/*When the MyClass class is initialized, I want to create a pointer to that function.
currently I am doing that in the constructor which I believe is OK to do.
*/
void (*f[1])(int32, int32) = {MyFunction1}
At compile time, the compiler complains:
error: argument of type 'void (CMyClass::)(int32, int32)' does not match 'void (*)(int32, int32)'
I tried a few things to rectify this based on the error message but only made things worse.
Any suggestions?
Thanks in advance...
Mike