I'm not really sure about my syntax here, I'm getting an "expected ;" error. I'm trying to store a pointer to a function in my class.
1 2 3 4 5 6 7 8
class myClass
{
public:
void SetCallbackFunction(void* pObj, void (*pFunc)());
private:
// this is written incorrectly
void (*pFunc)() callbackfunc_;
};
If someone could point me in the right direction, I'd appreciate it :)
typedefvoid (*pFunc_t)();
class myClass
{
public:
void SetCallbackFunction(void* pObj,pFunc_t pFunc);
private:
// this is written correctly
pFunc_t callbackfunc_;
};