2020年5月14日
摘要: 1,指针: 未初始化的指针通常会使得程序崩溃; 在C ++中,有几种使用其零参数构造函数创建对象的方法。 m = new IntCell( ); // OK m = new IntCell{ }; // C++11 m = new IntCell; // Preferred in this text 阅读全文
posted @ 2020-05-14 18:10 mmn 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 完整版本c++类: /** * A class for simulating an integer memory cell. */ class IntCell { public: /** * construct the IntCell. * Initial value is 0. */ IntCel 阅读全文
posted @ 2020-05-14 16:49 mmn 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 三步:三个文件去解决 1, /** * IntCell.h */ #ifndef IntCell_H #define IntCell_H /** * A class for simulating an integer memory cell/ */ class IntCell { public: e 阅读全文
posted @ 2020-05-14 16:39 mmn 阅读(1100) 评论(0) 推荐(0) 编辑