Original Post
I use function pointers in my CScript class, however they seem to not be working. I belive the problem lies in my typedef:
pFunc is a private member of CCommand. But I get an error message telling me that
typedef int (*pFunc)(CGame*);This is supposed to be a typedef for a func-pointer take a CGame pointer as an argument and returning an integer. Later on in my code I call it like this:
void CCommand::Execute(CGame *pGame)
{
int Result;
Result = pFunc(pGame);
}
C:\...\CCommand.cpp(46) : error C2440: ''='' : cannot convert from ''int (__cdecl *)(class CGame *)'' to ''int''Why wouldnt this work? is it my typedef, or could it be something else?