任何人都可以。请解释以下c程序的工作原理: 具体如何将函数'fun'分配给(*p)() = fun
;我需要知道编译器如何编译这段代码。c赋值运算符=
#include<stdio.h>
int fun(); /* function prototype */
int main()
{
int (*p)() = fun;
(*p)();
return 0;
}
int fun()
{
printf("Hello World\n");
return 0;
}
查找“函数指针”。 – Mysticial