g
case 1:p=new Manager(No,Name,Duty); break; case 2:p=new SalesManager(No,Name,Duty); break; case 3:p=new Sales(No,Name,Duty,Amount); break; case 4:p=new Technician(No,Name,Duty,T); break; }
p->next=0;
//员工结点加入链表
if(Worker) //若已经存在结点 {
Person *p2; p2=Worker;
while(p2->next) //查找尾结点 {
p2=p2->next; }
p2->next=p; //连接 }
else //若不存在结点(表空) {
Worker=p; //连接 }
//读下一条记录
fPerson>>No>>Name>>Duty; if(Duty==3)fPerson>>Amount; else if(Duty==4)fPerson>>T; }
fPerson.close();
cout<<"\n人员和基础数据已经装入...\n";