I'm a little new to function pointers (C++), and this part is confusing me. I have a global function for Keypress callbacks, like so:
void KeyPressCallback(int k, void (*p)());
I have a class which wants to use this function. Except I can't figure out how to pass one of its member functions ("void AKey();") as the parameter. I've tried these from within the class's initialization function:
KeyPressCallback(keyA, this->AKey);
KeyPressCallback(keyA, &ManagerClass::AKey);
both spur errors.
I also tried this from the function which calls the class's initialization function, after that call:
KeyPressCallback(keyA, gManager.AKey);
and still no go. So, what would be the correct syntax/method for doing what I'm trying to do?