/**
* 功能:使用函数指针
* 时间:2014年8月14日07:23:42
* 作者:cutter_point
*/
#include<iostream>
#include<cstdlib>
using namespace std;
void fun1()
{
cout<<"The function fun1 called.."<<endl;
}
int main()
{
void (*fp)(); //一个指向不需要参数的函数返回void
fp=fun1; //把函数地址给fp
//调用fp试一试
(*fp)();
void (*fp2)()=fun1; //同上
(*fp2)();
system("pause");
return 0;
}
【ThinkingInC++】17、使用函数指针
最新推荐文章于 2019-01-30 22:24:52 发布