函数指针

来源:互联网 发布:赵薇戴立忍事件 知乎 编辑:程序博客网 时间:2024/05/16 23:49
/*只是最简单的测试函数指针*/
#include<stdio.h>
voidfun(void(*f)(void))
{
     (*f)();
}
voidfun1(void)
{
     printf("This is the function 1 !/n");
}
voidfun2(void)
{
     printf("This is the function 2 !/n");
}
intmain(void)
{
     fun(fun1);
     fun(fun2);
}