一般定义:
int func (int x,int y)
{
......
}
int (*pf)(int,int);
void main(void)
{
int a=1;
int b=2;
int c;
pf = func;
c = (*pf)(a,b)
......
}
函数指针类型符定义
typedef int (*PF)(int,int)
PF g_pf;
int func (int x,int y)
{
......
}
void main(void)
{
int a=1;
int b=2;
int c;
g_pf = func;
c = g_pf(a,b)
......
}
阅读(2276) | 评论(0) | 转发(0) |