c++中this->name = other->name啥意思
时间: 2024-03-29 16:36:44 浏览: 12
在 C++ 中,关键字 `this` 指向当前对象的指针。`this->name` 表示当前对象的 `name` 成员变量,`other->name` 表示参数 `other` 所指向的对象的 `name` 成员变量。因此,`this->name = other->name` 的意思是将参数 `other` 所指向的对象的 `name` 成员变量的值赋给当前对象的 `name` 成员变量。