#include<iostream>
using namespace std;
//1、函数指针的基本用法
//1、声明一个函数类型
typedef void (myfunc)(int a, int b);
//myfunc *p = NULL; //定义一个函数指针,指向这个函数的入口地址
//2、声明一个函数指针类型
typedef void (* myPointfunc)(int a, int b);
//myPointfunc fp;//利用函数指针类型定义一个函数指针 ;
//3、定义一个函数指针变量
void(*myPointfunc2)(int a, int b);
void func(int a,int b){
cout << a << b << endl;
}
void func(int a){
cout << a << endl;
}
int main(){
myPointfunc fp = NULL;
fp = func;
fp(1,2); //用函数指针来调用函数。
system("pause");
}