错误代码
class school{
public:string name;static string address;
public:static string getAddress(){return address;}
};school::address = "南京路";
原因
school::address = “南京路”;前面未加类型,导致编译错误
解决
class school{
public:string name;static string address;
public:static string getAddress(){return address;}
};string school::address = "南京路";