If I have a prototype that is declared as:
void foo(int (*fi)(void *, void *))
我会像这样调用函数:
foo(int (*)(void*, void*)(bool_expr ? func1 : func2));
func1和func2的定义如下:
int func1(char *s1, char *s2);
int func2(int *i1, int *i2);
函数调用是否将函数(func1 ^ func2)中的一个转换为foo所需的函数类型?我也可以将foo的原型看起来像:
void foo(int (*)(void *, void *))