//和display()等函数。display()显示姓名、街道地址、城市和邮编等属性,chang_name()改变//对象的姓名属性,实现并测试这个类。
#include <>
int i,j,k;
//char name1[],add1[],city1[],postCode1[];
class Employee
{
public:
Employee(char name1[],char add1[],char city1[],char postCode1[]) ;
void t();
void change_name();
void display();
void jixu();
private:
char *name,*add,*city,*postCode,*name1;
};
Employee::Employee(char name1[],char add1[],char city1[],char postCode1[])
{
name = name1;
add =add1;
city = city1;
postCode = postCode1;
}
void Employee::change_name()
{
cin>>name1;
name=name1;
}
void Employee::t()
{
char name1[10], add1[10],city1[10], postCode1[10];
name = name1;
add =add1;
city = city1;
postCode = postCode1;
}
void Employee::display()
{
cout << " 姓名 : " << name << endl;
cout << " 街道地址 : " << add << endl;
cout << " 城市 : " << city << endl;
cout << " 邮政编码 : " << postCode << endl;
}
void Employee::jixu()
{
cout<<endl<<endl<<endl;
cout<<"是否要修改姓名信息:"<<endl<<" 1、是 2、否"<<endl;
cin>>i;
if(i==1) k=1;
if(i==2) k=0;
}
void main()
{
Employee abc("小明","建设一路","武汉","100056");
cout<<"修改前属性信息:"<<endl;
();
j=1;
while(j)
{
j=0;
();
j=k;
if(j==1)
{
cout<<"请输入姓名信息:"<<endl<<" ";
//cin>>name1;
();
();
();
}
}
}