Update 重要.cpp
赋值运算符重载拷贝的dest和src反了
This commit is contained in:
parent
696b01a42c
commit
bdde117539
@ -21,7 +21,7 @@ public:
|
||||
const String &operator=(const String &R)
|
||||
{
|
||||
length = R.length;
|
||||
strcpy(R.sPtr, sPtr);
|
||||
strcpy(sPtr, R.sPtr);
|
||||
return *this;
|
||||
}; //重载赋值运算符 =
|
||||
const String &operator+=(const String &R); //字符串的连接 +=
|
||||
|
Loading…
Reference in New Issue
Block a user