There is a structure of function pointers:
typedef struct { int (*pfnVidInit)(); .... } UI_FUNCTIONS; I need to create and fill an instance of this structure. In C, I simply entered the names of the functions:
static UI_FUNCTIONS gMenuFuncs = { Menu_VideoInit, ... }; Now I decided to try to change my menu in C ++:
static UI_FUNCTIONS gMenuFuncs = { Menu::getInstance()->VideoInit, ... }; But the compiler writes that it cannot cast int (Menu::)() (Menu::) int (Menu::)() to int (*)() Why is it there (Menu::) , but not (*) and how can I do (*) ?
VideoInit, for example - ixSciint (void)function:int Menu::VideoInit()- Vitaly KarpenkoVideoInitcan not be made static and not suffer? If not, then, you see, this function actually takes an additional parameter - a pointer to a class object ... So you can't call it as anint(). In my opinion, it is better to write a wrapper ... - Harry