在c++类中怎么写一个返回值是自身非引用类型的成员函数
class test{
char *name;
public:
test fun(test const &other);//这个函数怎么写 我想将other中的name的值传递给当前调用的对象,其他的方式我会写,但是这个函数的实现应该怎么写
};
2018-03-11 18:51
test func(test const &other) {
this->name = other.name;
return *this;
}
2018-03-12 18:47
2018-03-13 20:38
2018-03-13 21:13

2018-03-13 21:42