作者在 2010-09-02 23:20:03 发布以下内容
/*只是最简单的测试函数指针*/
#include<stdio.h>
void fun(void(*f)(void))
{
(*f)();
}
void fun1(void)
{
printf("This is the function 1 !\n");
}
void fun2(void)
{
printf("This is the function 2 !\n");
}
int main(void)
{
fun(fun1);
fun(fun2);
}
void fun(void(*f)(void))
{
(*f)();
}
void fun1(void)
{
printf("This is the function 1 !\n");
}
void fun2(void)
{
printf("This is the function 2 !\n");
}
int main(void)
{
fun(fun1);
fun(fun2);
}