I have a function with the following prototype:
void func(int an, ...);
And I would like to save the address of this function and call it later. I really don't know how to do this, I desesperatly tried:
void (*funcPtr)(int, ...);
funcPtr = func;
(*funcPtr)(3,2,5);
This code compiles fine, but when executed it crap, when I enter my function, the arguments in mine are va_listnot the ones I sent.
Thanks in advance
EDIT: Well, I just forgot the first argument. In my code above, the call string should be replaced with:
(*funcPtr)(3,3,2,5);
source
share