#include <iostream>
using namespace std;
int Func(int a, int b)
{
//cout << "a=" << a << endl;
//cout << "b=" << b << endl;
return a+b;
}
// 第一种:定义一种函数类型
typedef int(Func1)(int, int);
// 第二种:定义一种指向函数类型的指针类型
typedef int(*Func2)(int, int);
int main()
{
int a=10,b=20;
//第一种
Func1* p1 = NULL;
p1 = Func;
cout<<"第一种:"<<p1(a,b)<<endl;
//第二种
Func2 p2 = NULL;
p2 = Func;
cout << "第二种:" << p2(a, b) << endl;
//第三种:指向函数的指针
int (*p3)(int, int);
p3 = Func;
cout << "第三种:" << p3(a, b) << endl;
}