📄 worker.h
字号:
#include"common_people.h"
#ifndef worker_h
#define worker_h
class worker:virtual public common_people
{
friend class list;
public:
char department3[30];
char post2[30];
worker()
{
common_people();
department3[0]=post2[0]='\0';
}
worker(char *name1,int num,char *sex1,char *birth,char *depart,char*post0):common_people(name1,num,sex1,birth)
{
strcpy(department3,depart);
strcpy(post2,post0);
}
virtual void print();
virtual void getnode();
virtual void sav(char *nam);
};
//
void worker::sav(char *nam)
{ ofstream out(nam,ios_base::app);
out<<7<<endl<<type<<endl<<number<<endl<<name<<endl<<sex<<endl<<birthday<<endl<<maths<<endl<<computer<<endl<<english<<endl;
out<<department3<<endl<<post2<<endl;
out.close();
}
//
void worker::print()
{
common_people::print();
cout<<"工作部门:"<<department3<<" 职位:"<<post2<<endl;
}
//
void worker::getnode()
{
ptr=new worker(name,number,sex,birthday,department3,post2);
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -