If I have a prototype that is declared as:
void foo(int (*fi)(void *, void *))
And I call the function with something like this:
foo(int (*)(void*, void*)(bool_expr ? func1 : func2));
Where func1 and func2 are defined as follows:
int func1(char *s1, char *s2);
int func2(int *i1, int *i2);
Is the function call casting one of the functions (func1 ^ func2) to the type of the function required by foo? Could I also make the prototype for foo look like:
void foo(int (*)(void *, void *))
As commented the code as posted did not compile.
FWIW, this compiles and executes as you would expect with VC2010: