为什么在主函数中创建一个对象a里面的wori会报错?
class Employee {
private:
char Name;
char Adress;
int Zip;
public:
Employee(char name, char adress, int zip);
void change_name();
char getName()const { return Name; }
char getAdress()const { return Adress; }
char getZip()const { return Zip; }
void display() {
cout << "姓名:" << Name << endl;
cout << "街道地址:" << Adress << endl;
cout << "邮编:" << Zip << endl;
}
};
Employee::Employee(char name, char adress, int zip) { Name=name; Adress=adress; Zip=zip; }
void Employee::change_name() {
cout << "enter newname:" << endl;
cin >> Name;
cout << "change name:" << Name << endl;
}
int main()
{
Employee a("wori", "ca", "361026");
return 0;
}