2012年11月2日

C++深拷贝与浅拷贝

摘要: 转自:http://www.cnblogs.com/BlueTzar/articles/1223313.html对于普通类型的对象来说,它们之间的复制是很简单的,例如:int a=88;int b=a; 而类对象与普通对象不同,类对象内部结构一般较为复杂,存在各种成员变量。下面看一个类对象拷贝的简单例子。 #include <iostream> using namespace std; class CExample { private: int a; public: CExample(int b) { a=b; } void Show... 阅读全文

posted @ 2012-11-02 14:53 as_ 阅读(3725) 评论(0) 推荐(0) 编辑

导航