摘要:
#include#include/*因为t1,t6是全局变量,t4,t5是在外部函数中局部变量,所以构造函数调用完之后就是析构函数t1,t6,t2,t3 t4,~t4,t5,~t5, ~t3,~t2,~t6... 阅读全文
posted @ 2015-11-07 19:12
cloudren2020
阅读(69)
评论(0)
推荐(0)
摘要:
http://www.cnblogs.com/charley_yang/archive/2011/04/05/2005897.html一、嵌套类 在一个类的内部定义另一个类,我们称之为嵌套类(nested ... 阅读全文
posted @ 2015-11-07 19:09
cloudren2020
阅读(106)
评论(0)
推荐(0)
摘要:
#include#includeusing namespace std;/*浅拷贝:只拷贝值,不拷贝空间,自动Test t1 (t2)*//*深拷贝:*/class Test{ int *m_p;public: ... 阅读全文
posted @ 2015-11-07 18:52
cloudren2020
阅读(123)
评论(0)
推荐(0)
摘要:
#include#includeusing namespace std;class Test{ int m_data;public: Test(int i=0):m_data(i) { cout<<"Test(... 阅读全文
posted @ 2015-11-07 18:41
cloudren2020
阅读(96)
评论(0)
推荐(0)
摘要:
#includeusing namespace std;/*甚时候必须must使用初始化列表1.初始化const数据成员2.初始化引用数据成员3.初始化对象4.初始化父类成员变量*/class Test{ con... 阅读全文
posted @ 2015-11-07 18:28
cloudren2020
阅读(98)
评论(0)
推荐(0)

浙公网安备 33010602011771号