第六周实验报告(1)
来源:互联网 发布:bim软件有哪些 编辑:程序博客网 时间:2024/05/16 16:55
第一种修改方法
class C {private: int x; public: C(int x){this->x= x;} int getX(){return x;} }; void main() { C c(5); //去掉const cout<<c.getX(); system("pause"); }
第二种修改方法
class C {private: int x; public: C(int x){this->x= x;} int getX() const {return x;} //加上const,成为常成员函数 }; void main() { const C c(5); cout<<c.getX(); system("pause"); }
- 第六周实验报告1
- 第六周实验报告1
- 第六周实验报告1
- 第六周实验报告1
- 第六周实验报告1
- 第六周实验报告1
- 第六周实验报告(1)
- 第六周实验报告1
- 第六周实验报告1
- 第六周实验报告1
- 第六周实验报告
- 《第六周实验报告任务1》
- 第六周实验报告(1)
- 第六周实验报告(1)
- 第六周实验报告(任务1)
- 第六周C++实验报告(1)
- 第六周实验报告任务1
- 第六周实验报告4(1)
- boost库安装配置(windows平台)
- 2.Different ways of Converting and Casting objects to different types of objects
- VBS实现定时关机
- 第六周 任务二
- 提高flex应用性能方法
- 第六周实验报告(1)
- 第六周实验报告(2)
- BT5 set_config各个选项的配置(1)
- poj 1088 滑雪[zz] 记忆化搜索
- 学习笔记——CSS
- 第六周实验报告(3)
- 如何撰写产品需求文档(PRD文档)
- 第六周实验报告(4)
- 判断dataset为空的方法