爱德草

Results 1 issues of 爱德草

对于 https://csguide.cn/cpp/object_oriented/deep_copy_and_shallow_copy.html 中的代码有些疑问:作者给出的代码即使我删去深拷贝的部分,也就如下代码,仍然没有出现修改一方会影响另一方的现象 ``` #include #include class MyClass { public: MyClass(const char* str) { data = new char[strlen(str) + 1]; strcpy(data, str); } // 深拷贝的拷贝构造函数 // MyClass(const MyClass& other) {...