函数指针的调用方法,显示调用与隐示调用

来源:互联网 发布:开淘宝图片详细怎么弄 编辑:程序博客网 时间:2024/06/18 07:18

int plus(int a,int b){

    return a+b;

    }

int (*pf)(int,int);

int main()

{

pf=plus;

//显示调用

cout<<(*pf)(1,2)<<endl;

//隐示调用

cout<<pf(1,2)<<endl;

system("pause");

return 0;

}