请考虑以下代码
#include<stdio.h>
int fun(); /* function prototype */
int main()
{
int (*p)() = fun;
(*p)();
return 0;
}
int fun()
{
printf("IndiaBix.com\n");
return 0;
}
这里的int(*p)()
是什么?是函数、变量还是什么?
最佳答案
流量spiral rule :
+------+
| |
| +-+ |
| ^ | |
int ( *p ) ()
^ | | |
| +----+ |
+--------+
Identifier p
is a pointer to..
is a pointer to a function
is a pointer to a function returning int
关于c - c 中的指针和函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18810308/