Answer by Nikolai Fetissov for Function pointer as parameter
Replace void *disconnectFunc; with void (*disconnectFunc)(); to declare function pointer type variable. Or even better use a typedef:typedef void (*func_t)(); // pointer to function with no args and...
View ArticleAnswer by GManNickG for Function pointer as parameter
The correct way to do this is:typedef void (*callback_function)(void); // type for concisenesscallback_function disconnectFunc; // variable to store function pointer typevoid...
View ArticleAnswer by WhirlWind for Function pointer as parameter
You need to declare disconnectFunc as a function pointer, not a void pointer. You also need to call it as a function (with parentheses), and no "*" is needed.
View ArticleFunction pointer as parameter
I try to call a function which passed as function pointer with no argument, but I can't make it work.void *disconnectFunc;void D::setDisconnectFunc(void (*func)){ disconnectFunc = func;}void...
View Article
More Pages to Explore .....