动态分配内存版本实现的通讯录。
没什么好说的,就只是增删查改之类的功能,直接上代码了
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<Windows.h>
#define MAXN 20
#define MAXS 5
#define MAXA 15
static count = 1;
static int peocnt = 1;
typedef struct
{
char name[MAXN];
char sex[MAXS];
char addr[MAXA];
char num[11];
int age;
}stu;
enum optin//枚举类型(用在main函数的switch分支语句中,免得写出挫挫的case 1之类的代码)
{
EXIT,//0
ADD,//1
DEL,//2
SEARCH,//3
MODIFY,//4
SHOW,//5
EMPTY,//6
};
void menu()
{
printf("*************************************************************\n");
printf("****** 1增加通讯录人数 2删除通讯录人数 *******\n");
printf("****** 3查找通讯录 4修改通讯录 *******\n");
printf("****** 5显示通讯录 6清空通讯