函数指针例子

来源:互联网 发布:mac os系统dmg镜像 编辑:程序博客网 时间:2024/05/16 16:59
#include <stdio.h>#include <stdlib.h>typedef int (*pf)(int) ;int print_self(int value){printf("the value is %d\n",value);return 1;}int test(int dd, pf ppp){ppp(dd);return 1;}int main(){int i = 10;test(i,print_self);return 1;}

0 0