摘要: 对象成员指针实例化时,先调用嵌套构造函数,在构造line函数。 销毁对象时,先销毁嵌套构造函数coordinate,在销毁line函数,这个和嵌套对象成员函数不一样。 coordinate.h #pragma onceclass coordinate{public: coordinate(int x 阅读全文
posted @ 2017-11-23 23:14 boht 阅读(139) 评论(0) 推荐(0) 编辑
摘要: .h 文件 #pragma onceclass coordinate{public: coordinate(); ~coordinate();public: int m_ix; int m_iy; }; .cpp 文件 #include "stdafx.h"#include "coordinate. 阅读全文
posted @ 2017-11-23 21:37 boht 阅读(128) 评论(0) 推荐(0) 编辑
摘要: .h 文件 #pragma onceclass Array{public: Array(int count); Array(const Array &arr); ~Array(); void setcount(int count); int getcount(); void printAddr(); 阅读全文
posted @ 2017-11-22 23:35 boht 阅读(165) 评论(0) 推荐(0) 编辑
摘要: .h 文件 #pragma onceclass Array{public: Array(); Array(const Array &arr); ~Array(); void setcount(int count); int getcount(); private: int m_iCount;}; . 阅读全文
posted @ 2017-11-21 22:19 boht 阅读(376) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"#include <vector>#include <iostream>using namespace std; int main(){ vector<int> ivec; int ival; cout << "enter number(ctrl+z to en 阅读全文
posted @ 2017-11-20 23:06 boht 阅读(1150) 评论(0) 推荐(0) 编辑