函数指针的使用

来源:互联网 发布:pk10助赢软件 编辑:程序博客网 时间:2024/05/20 10:13
#include <stdio.h>int max(int x,int y){return x>y?x:y;}int main(){int max(int,int);int (*p)(int,int)=&max;int a,b,c,d;printf("Please input three integer \n");scanf("%d %d %d",&a,&b,&c);d=(*p)((*p)(a,b),c);printf("Among %d,%d,%d ,the max integer is %d \n",a,b,c,d);return 0;}/*函数指针,即指向函数的指针void (*f)();函数返回指针,即指针函数void *f();*/

原创粉丝点击