chainlist.cpp

来自「设计并实现一个简单的大学人员信息管理系统。对各类人员信息进行管理」· C++ 代码 · 共 47 行

CPP
47
字号
// chainList.cpp: implementation of the chainList class.
//
//////////////////////////////////////////////////////////////////////

#include "chainList.h"
#include"persons.h"
#include"student.h"
#include"teacher.h"
#include"empoyee.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

chainList::chainList(int type,persons*pp)
{
	next=0;
	typeOfPn=type;
	if(pp)
	{
		switch(type)
		{
		case 1:
			pl=new student(pp);
			break;

		case 2:
			pl=new teacher(pp);
			break;
			
		case 3:
			pl=new empoyee(pp);
			break;

		default:
			pl=0;
			
		}
	}
	else
		pl=0;
}

chainList::~chainList()
{
delete pl;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?