摘要:
本篇文章主要讲解了C++中构造函数、析构函数、拷贝构造函数的容易产生理解上错误的地方。大家也可以作为检验对知识点掌握的情况!首先代码如下:class CStudent {public: CStudent() { } CStudent(CStudent& stu) { } ~CStudent() { }};int main(){ CStudent stu1; CStudent stu2(stu1); // 这行代码如何解释? CStudent stu3(); return 0; } 以上注释的那行代码该怎么解释?实例化了一个对象并显示的调用了默认的构造函数?如果真这... 阅读全文
posted @ 2013-04-23 17:42
0x苦行僧
阅读(347)
评论(0)
推荐(0)