0
void cAppMath::vregisterFunc(int index, int(*fPtr)(int a, int b))       //Application to register their functions
{
    arrFptr[index] = fPtr;
}

int main()
{
appObj.vregisterFunc(EN_ADD, &cAppMath::add);       //application that is registering the callbacks.
}

{

Getting follwoing ERROR in vregisterFunc() func call.

Error 1 error C2664: 'void cAppMath::vregisterFunc(int,int (__cdecl )(int,int))' : cannot convert argument 2 from 'int (__thiscall cAppMath:: )(int,int)' to 'int (__cdecl *)(int,int)'

IntelliSense: argument of type "int (cAppMath::)(int a, int b)" is incompatible with parameter of type "int ()(int a, int

}

Edited by prahesh

2
Contributors
1
Reply
11
Views
1 Year
Discussion Span
Last Post by deceptikon
0

Clickie to learn about the difference between a pointer to a function and a pointer to a member function. They're not even close to the same thing.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.