scanf("%d",&num);
switch(num)
{
case 1:
{
char ch;
while(1)
{
printf("是否要添加信息(Y/N)\n");
do{
ch=getchar();
}
while(ch!='Y'&&ch!='N');
if(ch=='Y')
{
addPeople(&txl);
}
else
{
break;
}
}
break;
}
case 2:
{
char query[20];
pcharacter result;
printf("请输入查询信息姓名:\n\n");
scanf("%s", query);
result = searchPeople(txl, query);
displaySingle(result);
break;
}
case 3:
{
char query[20];
pcharacter result;
printf("请输入修改信息姓名:\n\n");
scanf("%s",query);
result=updatePeople(txl,query);
displayCharacter(txl);
break;
}
case 4:
{
char query[20];
printf("请输入删除信息姓名:\n\n");
scanf("%s", query);
delPeople(&txl, query);
break;
}
case 5:
{
printf("打印通讯录信息如下:\n\n");
displayCharacter(txl);
break;
}
case 6:
{
goto END;
}
}
}
END:
printf("退出程序\n");
}
C语言通讯录设计及通讯录设计源代码(6):http://www.751com.cn/fanwen/lunwen_71172.html