蔡諝的窝

博客园 首页 新随笔 联系 订阅 管理

2011年10月12日 #

摘要: Int(*(*F)(int,int))(int)的实现如下:----------------------------------------------------typedef int (*pfun)(int);//定义类型——函数指针int fun1(int c=0){ return c+10;}int fun2(int c=0){ return c+20;}pfun choose(int a,int b){ pfun p; if(a>b) p=fun1; else p=fun2; return p;}void main(){ pfun (*F)(int,int)=choose; i 阅读全文
posted @ 2011-10-12 16:02 蔡諝 阅读(879) 评论(0) 推荐(0)