创建一个employee,用字符数组包含姓名,街道地址,市,省,邮政编码,并且输出完成数据
#include<bits/stdc++.h>
using namespace std;
class employee
{
private:
char name[10];
char address[20];
char city[10];
char province[15];
char pcode[30];
public:
employee(char na[10],char add[20],char ci[10],char prov[15],char pc[30])
{
strcpy(name,na);
strcpy(address,add);
strcpy(city,ci);
strcpy(province,prov);
strcpy(pcode,pc);
}
void changname(char na[])
{
strcpy(name,na);
}
void display()
{
cout<<name<<endl;
cout<<address<<endl;
cout<<city<<endl;
cout<<province<<endl;
cout<<pcode<<endl;
}
};
int main()
{
employee em("uzi","aaa","xx","qq","w");
em.display();
}