函数指针的使用
来源:互联网 发布:php cookie 跨域共享 编辑:程序博客网 时间:2024/05/22 03:43
#include<iostream>
using namespace std;
int max1(int x,int y)
{
return x>y?x:y;
}
int main()
{
int max1(int,int);
int (*f)(int,int)=&max1;//函数指针
int a,b,c,d;
cout<<"Enter three numbers:"<<endl;
cin>>a>>b>>c;
d=(*f)((*f)(a,b),c);
cout<<"The largest number is: "<<d<<endl;
return 0;
}
using namespace std;
int max1(int x,int y)
{
return x>y?x:y;
}
int main()
{
int max1(int,int);
int (*f)(int,int)=&max1;//函数指针
int a,b,c,d;
cout<<"Enter three numbers:"<<endl;
cin>>a>>b>>c;
d=(*f)((*f)(a,b),c);
cout<<"The largest number is: "<<d<<endl;
return 0;
}
0 0
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 指针函数的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 函数指针的使用
- 迭代器失效
- PHP数据库扩展GOOD
- Points, lines, and planes
- 插入一序列的key-value的map
- Python Excel Tutorial 指南
- 函数指针的使用
- 一个比较全的在线帮助文档
- 【产品经理】如果再让我做一回产品经理
- laravel routes除了默认路由,其他都无效 解决办法
- android.view.inputmethod
- 第七周项目三——简单分支问题(一)
- IOS XMPP的实践
- GitHub上最火的40个Android开源项目
- C#中的多播委托笔记总结