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

📄 list.h

📁 Visual C++做的一个学生学习管理系统 内有源码和说明
💻 H
字号:

/////////////////////////////////////////////////////////////////////
///////////// List.h: 类的所有成员都在头文件里声明 //////////////////
/////////////////////////////////////////////////////////////////////

#include <iostream.h>     // cin 及 cout
#include <malloc.h>       // 用到申请内存函数 malloc() 和释放内存函数 free()
#include <string.h>		  // 字符串处理
#include <stdio.h>		  // 文件操作(读文件)
#include <stdlib.h>		  // system("cls")

struct address				   /*家庭地址*/
{ 
		char city[10];		   /*城市*/
		char town[10];	   	   /*县城*/
		char village[10];	   /*乡镇*/
};

struct telephone				   /*联系方式*/
{
		char SJ[50];			   /*手机*/
		char JD[30];			   /*家庭电话*/
		char XD[30];			   /*学校电话*/
};

struct person					/*个人信息*/
{  
		char name[20];          /*名字*/ 
		char sex[10] ;          /*性别*/ 
		char MZ[16];			/*民族*/
		char GJ[17];			/*国籍*/  
		char XL[19];			/*学历*/
};	

struct score						//成绩
{
		char num[20];				//学号
		char english[20];
		char chinese[20];
		char math[20];
		char physics[20];
};

typedef struct linknode			//定义节点的类型
{
		char address[100];		//地址
		char birthday[100];		//出生日期
		struct score sc;		//成绩
		struct person pe;		//个人信息
		struct telephone te;	//联系方式
		bool flag;
		struct linknode* next;
}nodetype;

class List
{
	nodetype* head;

public:
	List();
	List::~List();

	linknode* creatlist(int);				//创建链表
	int listlen();							//返回链表长度
	nodetype* findnode(int);				//通过查找序号返回节点的指针
	nodetype* find(char c[]);				//通过查找姓名返回节点的指针
	int find2(char c[]);					//通过查找姓名返回节点的序号
	nodetype* insnode(int);					//插入节点
	void delnode(int);						//删除节点

	nodetype* load();						//初始化:从外部读入数据

	void readstr(FILE *f,char *string);		//读行函数
	bool check(char *a, char *b);			//对比两个字符串是否相等
	void help();							//显示帮助菜单

	void editperson(nodetype*);				//编辑个人说明
	void editscore(nodetype*);				//编辑学科成绩
	void edittelephone(nodetype*);			//编辑联系方式

	void dispname();						//显示所有学生姓名
	void dispnode(nodetype* p);				//显示一个学生的所有信息
	void dispperson(nodetype*);				//显示一个学生的个人说明
	void dispscore(nodetype*);				//显示一个学生的学科成绩
	void disptelephone(nodetype*);			//显示一个学生的联系方式

};

⌨️ 快捷键说明

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