【发布时间】:2014-08-23 07:31:42
【问题描述】:
您好,我无法弄清楚函数指针在下面的代码中是如何 typedef 的。请谁能解释一下
#include<stdio.h>
typedef int(*fp)(int,int) ; this is typedef with function pointer i m unable to figure out?
int sum (int,int);
int main()
{
fp p,q; // p, q become function pointer too how?
p=sum;
printf("%d\n",p(20,10));
}
int sum(int i,int j)
{
return(i+j);
}
【问题讨论】:
标签: c function-pointers typedef