scanf("%s", copy -> Address);
return copy;
}
}
}
if(copy==NULL)
{
return NULL;
}
}
void delPeople(ppcharacter txl,char query[])
{
pcharacter big,middle;
big=NULL;
middle=*txl;
while(middle!=NULL&&strcmp(middle->Name,query))
{
big=middle;
middle=middle->next;
}
if(middle==NULL)
{
printf("没有联系人\n");
}
else
{
if(big==NULL)
{
*txl=middle->next;
}
else
{
big->next=middle->next;
}
printf("删除成功\n");
}
}
void displayCharacter(pcharacter txl)
{
pcharacter person;
person=txl;
while(person!=NULL)
{
printf("----------------------------------------------\n");
printf("姓名\t年龄\t性别\t手机号码\t住址信息\n");
printf("%s\t",person->Name);
printf("%s\t",person->Year);
printf("%s\t",person->Sex);
printf("%s\t\t",person->Tel);
printf("%s\n",person->Address);
printf("----------------------------------------------\n");
putchar('\n');
person=person->next;
}
}
void displaySingle(pcharacter txl)
{
if(txl==NULL)
{
printf("联系人不存在\n");
}
else
{
printf("----------------------------------------------\n");
printf("姓名\t年龄\t性别\t手机号码\t住址信息\n");
printf("%s\t",txl->Name);
printf("%s\t",txl->Year);
printf("%s\t",txl->Sex);
printf("%s\t\t",txl->Tel);
printf("%s\n",txl->Address);
printf("----------------------------------------------\n");
}
}
int main()
{
int num;
pcharacter txl=NULL;
printf("\t\t|-----------通讯录菜单----------- |\n");
printf("\t\t| 1. addPeople |\n");
printf("\t\t| 2. searchPeople |\n");
printf("\t\t| 3. updatePeople |\n");
printf("\t\t| 4. delPeople |\n");
printf("\t\t| 5. displayCharacter |\n");
printf("\t\t| 6. END |\n");
printf("\t\t|---------------------------------|\n\n");
printf("\t\t\t功能选择(1-6):");
printf("\n");
while(1)
{
printf("输入选择的功能:\n");