?? liststudent.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 + -