http://blog.csdn.net/alan00000/article/details/7748537 示例代码如下: #include <stdio.h> int asdf(int a) { printf("%d\n",a); return 0; } int main() { int (*p)(int); asdf(5); p=asdf; (*p)(5);
函数指针 #include<stdio.h>//声明函数指针typedef int(*Calc)(int a, int b);int Add(int a, int b){return a + b;}int Sub(int a, int b) {return a - b;}int main() {Calc funcPoint1 = &Add;Calc funcPoint2 = &Sub