#include <iostream>
using namespace std;
void myFunc(int a)
{
printf("a:%d\n",a);
}
void myFunc(char *p)
{
printf("p:%s\n",p);
}
void myFunc(int a,int b)
{
printf("a:%d+b:%d\n",a,b);
}
//函数指针
//声明一个函数类型(用这个类型可以定义变量)
typedef void (myTypeFunc)(int a,int b);
//声明一个函数指针类型
typedef void (*myPTypeFunc)(int a,int b);
//定义一个函数指针变量
void (*myPFunc)(int a,int b);
int main()
{
myPTypeFunc fp;//定义了一个函数指针变量
fp = myFunc;
fp(1,2);
myPFunc = fp;
fp(1,2);
system("pause");
return 0;
}