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

📄 list.h

📁 简单的vc++比编译通讯录,适用于学生课程设计和程序改写。
💻 H
字号:
#include <iostream.h>     
#include <malloc.h>       // 用到申请内存函数 malloc() 和释放内存函数 free()
#include <string.h>		  // 字符串处理
#include <stdio.h>		  // 文件操作(读文件)
#include <stdlib.h>		  

struct person					/*个人信息*/
{  
		char name[20];          /*姓名*/ 
		char sex[10] ;          /*性别*/ 
		char address[100];		//地址
		
};	

struct telephone				   /*联系方式*/
{
		char mobill[50];		   /*手机*/
		char JTtel[30];			   /*家庭电话*/
};

typedef struct linknode			//定义节点的类型
{
		
		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* find1(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 edittelephone(nodetype*);			//编辑联系方式

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

⌨️ 快捷键说明

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