C++三巨头原则C++三巨头原则
C++三巨头原则BIG THREE:copy ctorcopy=dtorcomplx c1(0,0);//构造函数complex * pc = new complex;//构造函数complex c2(c1);//拷贝构造函数complex c3 = c1;//拷贝构造函数c3 = c2;//赋值构造函数delete pc;//析构函数copy ctor如果不自定义拷贝构造函数,编译器自带的是bit-wise copy,即浅拷贝如果一个类数据成员有指针变量,必须手动实