#include<stdio.h>
#include<stdlib.h>
typedef int (*fp)(int,int);
typedef int (**sfp)(int,int);
int add (int a,int b)
{
return a+b;
}
int main()
{
fp fp_m=&add;
fp_m(1,2);
(*fp_m)(1,2); //函数指针和函数名指向地址相同
//sfp sfp_m= &fp_m; //此格式ok
sfp sfp_m = &(&add)//此格式error
(*sfp_m)(1,2);
printf("%d\n",1);
return 0;
}
二级函数指针
最新推荐文章于 2024-04-27 15:25:53 发布