[C]我看到了这样的代码片断,不解其中的函数指针
gcc -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.4.2 [FreeBSD] 20040728
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>make 下面的代码都没警告
#include <stdio.h>
int
test(int a)
{
printf("%d\n", a);
}
int
reffoo(int val, int (*fp) (int))
{
return fp(val);
}
int
main()
{
reffoo(3, *test);
reffoo(4, &test);
reffoo(5, test);
return 0;
}