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

}

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.