这样啊,以前确实没接触过,呵呵。
程序代码:
typedef (*pfun)();
int *p;
void test()
{
int a=1;
int b=2;
printf("%d\n",a+b);
}
void callfun(pfun testfun)
{
testfun();
}
void callp(int * testfun)
{
pfun tmp=(pfun)testfun;
tmp();
}
void main()
{
test();
callfun((pfun)test);
p=test;
callp(p);
}