1.指向函数的数组很有用要重点关注
2.指向函数的指针最好有合适的命名
<引用>一个很好的例子:
#include<stdio.h>
#define MAX 100
typedef char *(*PtoFun)();
main()
{
void *call(PtoFun);
PtoFun RtnFunc();
printf("%s",call(RtnFunc()));
return 0;
}
char *hello()
{
return "Hello World!/n";
}
PtoFun RtnFunc()
{
return hello;
}
void *call(PtoFun func)
{
return (*func)();
}
#define MAX 100
typedef char *(*PtoFun)();
main()
{
void *call(PtoFun);
PtoFun RtnFunc();
printf("%s",call(RtnFunc()));
return 0;
}
char *hello()
{
return "Hello World!/n";
}
PtoFun RtnFunc()
{
return hello;
}
void *call(PtoFun func)
{
return (*func)();
}