64,651
社区成员
发帖
与我相关
我的任务
分享
#include <string>
#include <iostream>
using namespace std;
class Person {
private:
string strName;
string strAddress;
public:
Person() = default;
Person(const string &name, const string &add)
{
strName = name;
strAddress = add;
}
Person(istream &is) { is >> *this; } //这里编译无法通过
public:
string getName() const { return strName; }
string getAddress() const { return strAddress; }
};