⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 liststudent.h

📁 学生信息管理系统 姓名 年龄 性别 学号 成绩
💻 H
字号:
#ifndef LISTSTUDENT_H_
#define LISTSTUDENT_H_
#include <iostream>
#include "linkstudent.h"
using namespace std;

class Liststudent
{
	private:
	Linkstudent *first;
	Linkstudent *tail;
	int size;

	void initial(){ first = tail = new Linkstudent; size = 0;}
	void removeall()
	{
		Linkstudent *temp;
		while(first != NULL)
		{
			temp = first;
			first = first->next;
			delete temp;

		}
		
		size = 0;
	}
	public:
		//constructor and destructor
		Liststudent(){ initial(); }
		~Liststudent(){ removeall();}
		void clear(){ removeall(); initial();}
		//add the student
		bool append(const Student &);
		bool insert(const Student &);//add to the front of the list
		//delete specific student  accooding to the name or snumber
		bool remove_n(char *n);
		bool remvoe_sn(char *sn);
		//find the student acoording to the name or snumber
		Linkstudent * find_n(char *n);
		Linkstudent * find_sn(char *sn);

		bool empty()const{ 

			if(first == tail) return true;
			else return false;
		}



		void show_all()const;

};
#endif

⌨️ 快捷键说明

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