摘要: copy构造函数被用来"以同型对象初始化醉卧对象",copy assignment操作符被用来"从另一个同型对象中拷贝其值到自我对象":#include "stdafx.h"#include using namespace std;class Widget{public:Widget();//默认构造函数Widget(const Widget& rhs);//复制构造函数Widget& operator = (const Widget& rhs);//赋值操作符};int _tmain(int argc, _T 阅读全文
posted @ 2013-10-12 16:10 CrazyCode. 阅读(405) 评论(0) 推荐(0) 编辑
摘要: size_t只是一个typedef,是c++计算个数,如字符串内的字符个数或者stl容器内的元素个数时用的某种不带正负号unsigned类型。它也是vector,deque和string内的operator[]函数接受的参数类型。 阅读全文
posted @ 2013-10-12 15:52 CrazyCode. 阅读(128) 评论(0) 推荐(0) 编辑