#include <stdio.h>
typedef int(FUNCTION)(int);
int f(int i)
{
return i;
}
void f1()
{
printf("hello world!\n");
}
int main(void)
{
FUNCTION* func = f;
printf("%d\n",func(13));
void(*pf)() = &f1; //老的编译器使用的方法;新的编译器的使用方法:void(*pf)() = f1;
pf(); //新的编译器使用的方法,函数调用方法
(*pf)(); //老的编译器使用的方法,函数调用方法
printf("---end---\n");
return 0;
}
函数指针的使用
最新推荐文章于 2022-03-31 14:40:48 发布