7.23构造函数
来源:互联网 发布:淘宝跨店凑单什么意思 编辑:程序博客网 时间:2024/06/05 15:50
/*构造函数*/
#include<iostream>
using namespace std;
class Box{
public:
Box
{
length=1;width=2;height=3;
}
void Show()
{
cout<<"length is :"<<length<<'\t'<<"width is :"<<width<<'\t'
<<"height is :"<<height<<endl;
}
private:
{
float length,width,height;
};
int main()
{
Box box1;
cout<<"the information of box1 is :"<<endl;
box1.Show;
Box box2;
cout<<"the information of box2 is :"<<endl;
box2.Show;
return 0;
}
#include<iostream>
using namespace std;
class Box{
public:
Box
{
length=1;width=2;height=3;
}
void Show()
{
cout<<"length is :"<<length<<'\t'<<"width is :"<<width<<'\t'
<<"height is :"<<height<<endl;
}
private:
{
float length,width,height;
};
int main()
{
Box box1;
cout<<"the information of box1 is :"<<endl;
box1.Show;
Box box2;
cout<<"the information of box2 is :"<<endl;
box2.Show;
return 0;
}
0 0
- 7.23构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 构造函数
- 支付宝服务窗 开发 验证
- form不提交问题
- 难道他能通过电话
- hdu 4923 Room and Moor
- SOA、网格计算、云计算与P2P技术
- 7.23构造函数
- CSDN积分排名记录
- 【Android开发-5】界面装修,五大布局你选谁
- hive基本命令
- Android事件分发机制完全解析,带你从源码的角度彻底理解(下)
- Codeforces 61E Enemy is weak 求i<j<k && a[i]>a[j]>a[k] 的对数 树状数组
- BOJ 480 田田背课文
- 【索引】Basic Problems
- hive表信息查询:查看表结构、表操作等