dynamic-memory-allocation assignment-operator 问答列表

为什么需要在 c++ 运算符重载中删除内存并分配新内存

作者:Ahmed Salama 提问时间:6/22/2021

我正在检查赋值运算符实现,但我不明白这一点: const MyString& operator=(const MyString& rhs) { if (this != &rhs) { dele...


共1条 当前第1页