/********************************************** 统一接口实现不同的内容 ***********************************************/ #include <stdio.h> typedef int (*pfunc)(int); //定义一个函数指针 int myfunc(int tmp) { printf("yeah,girl,this is my function/n"); printf("%d/n",tmp); return 0; } int yourfunc(int tmp) { printf("hey,man,this is your function/n"); printf("%d/n",tmp+5); return 0; } call(pfunc p,int tmp) { p(tmp); } int main(int argc,char * argv) { call(myfunc,6); call(yourfunc,6); return 0; }