2015年6月4日

构造函数与析构函数

摘要: 1 /* 构造函数与析构函数 */ 2 3 #include 4 5 // 所有的类 默认都有一个构造函数与析构函数 6 // 构造函数和析构函数可以重载,没有返回值 7 class myclass 8 { 9 public:10 int num;11 public:12 my... 阅读全文

posted @ 2015-06-04 14:43 Dragon-wuxl 阅读(133) 评论(0) 推荐(0)

mutable

摘要: 1 /* mutable */ 2 3 #include 4 5 using namespace std; 6 7 class myclass 8 { 9 public:10 int num;11 // mutable 声明的变量 不受const 限制 可以在成员函数中修改12 ... 阅读全文

posted @ 2015-06-04 13:01 Dragon-wuxl 阅读(159) 评论(0) 推荐(0)

导航