第6周项目一:改错
来源:互联网 发布:sql去掉重复记录 编辑:程序博客网 时间:2024/06/04 18:11
错误代码:
#include<iostream>#include<stdlib.h>using namespace std;class C{private: int x; public: C(int x){this->x = x;} int getX(){return x;}};int main(){ const C c(5); cout<<c.getX(); return 0;}
错误列表:
改错1:
#include<iostream>#include<stdlib.h>using namespace std;class C{private: int x;public: C(int x) {this->x=x;} int getX() const {return x;}};int main(){ const C c(5); cout<<c.getX(); system("PAUSE"); return 0;}
改错2:
#include<iostream>#include<stdlib.h>using namespace std;class C{private: int x;public: C(int x) {this->x=x;} int getX() {return x;}};int main(){ C c(5); cout<<c.getX(); system("PAUSE"); return 0;}
运行结果:
- 第6周项目一:改错
- C++第6周项目1 - 改错
- 第6周-项目1-改错
- 第六周项目一:改错
- 第六周项目一改错
- 第7周项目-程序改错
- 第二学期第13周项目--改错
- 第7周项目4改错
- 第六周项目一const的改错
- 第六周项目一程序改错
- 项目一(改错)
- 第一周 项目一:程序改错(第一种改法)
- 第六周 项目一:程序改错(第二种改法)
- 第六周项目1 改错
- 第六周任务一 改错
- 第9周项目2592: 改错题B--数组元素交换
- 第四周 项目一 改错 s(面积)=sqrt(p*(p-a)*(p-b)*(p-c))
- 第六周项目一(对程序进行改错)---两种方法
- 第六周项目1 撞错的心思
- Facebook & Twitter sdk for ios 开发笔记
- 项目二--程序填空
- WAMPServer更改web根目录
- 银行家算法
- 第6周项目一:改错
- 项目一
- 第六周项目1—常对象
- Linux基础(四):硬盘分区编号规则
- 4.4
- 长方体
- HDOJ题目分类
- ANT获取时间
- Android 通过http协议数据交互