程序介绍
通讯录管理系统主要是实现对联系人的增、删、查以及显示的基本操作。用户可以根据自己的需要在功能菜单中选择相应的操作,实现对联系人的快速管理。
操作流程
用户在编译完成后会产生一个系统的可执行文件,用户只要双击可执行文件就可以进入系统,进入系统的功能选择菜单,如图所示,用户根据自己的需要选择相应的操作。
代码
#include<stdio.h>
#include<stdlib.h>
#include<dos.h>
#include <conio.h>
#include<string.h>
struct Info
{
char name[15];/*姓名*/
char city[10];/*城市*/
char province[10];/*省*/
char state[10];/*国家*/
char tel[15];/*电话*/
};
typedef struct node/*定义通讯录链表的结点结构*/
{
struct Info data;
struct node *next;
}Node,*link;
void stringinput(char *t,int lens,char *notice)
{
char n[50];
do{
printf("%s",notice); /*显示提示信息*/
scanf("%s",&n); /*输入字符串*/
if(strlen(n)>lens)
printf("\n exceed the required length! \n"); /*超过lens值重新输入*/
}while(strlen(n)>lens);
strcpy(t,n); /*将输入的字符串拷贝到字符串t中*/
}
void enter(link l)/*输入记录*/
{
Node *p,*q;
q=l;
while(1)
{
p=(Node*)malloc(sizeof(Node));/*申请结点空间*/
if(!p)/*未申请成功输出提示信息*/
{