参考:
https://www.cnblogs.com/guanguangreat/p/6117988.html
http://blog.csdn.net/big_kingwang/article/details/50527790
简单实例:
#include <iostream>
using namespace std;
//定义一个函数指针
int (*add)(int,int);
//定义一个类型,其变量为函数指针,类型名字为ADD
typedef int (*ADD)(int,int);
//定义一个函数,其类型可以简写成 int()(int,int)
int sum(int a, int b) {
return a+b;
}
int main() {
int a = 5, b = 6;
add = sum;
ADD s = sum;
cout << "sum:" << (sum)(a,b) << endl;
cout << "sum:" << sum(a,b) << endl;
cout<<"add:"<<(add)(a,b)<<endl;
cout << "typedef ADD:" << (s)(a,b) << endl;
return 0;
}