复制构造函数 等号进行重载运算符时,应该重写复制构造函数,避免两个对象指向同一空间 String (const String &S) { str = new char[strlen(s.str)+1]; strcpy(str, s.str); }