I am working with function pointer in c++ , and i am wonderring if any function pointer type which can use for every function, dont care about return value, list argument or how many argument. If it is possible, how is it work?
example:
I have some functions:
void F1(void);
void F2(int);
int F3(int, char*);
float F4(int, float);
int F5(MyClass);
....
if: i have
typedef (void) (*fp1)(void); i can call : fp1 x = &F1;
if: i have
typdef (float) (*fp2)(int, float); i can call : fp2 x = &F4;
now I need some kind of function pointer to store all of them.
something like this:
typedef void(function_pointer)(void)
or typedef void(function_pointer)(void, ...) // but both dont work.
And one more infomation: i have tried to use template, but it didn't solve my problem Thanks.