在主函数中给类中的字符串类型对象赋值出现问题
程序代码:
//这是类部分: class Student { private: string name; char sex; int ID; int num; int score; public: Student(){name="zero";sex=0;ID=0;num=0;score=0;} Student(string na,char s,int i,int n,int sc):name(na),sex(s),ID(i),num(n),score(sc){} void change(Teacher &t); void display(); friend Teacher; }; //这是主函数部分: Student s1("zhangli","m",46003199209090033,2013011140,88),s2;