}
printf(\选择功能错误,请重新选择。\\n\break;
} //end of switch
printf(\按任意键继续......\\n\getch();
} // end of while return 0;
STU *mycreate()/*创建链表*/ {
STU *head,*p,*q;
head = (STU *)malloc(sizeof(STU)); q = head;
printf(\请输入:电话号码姓名性别单位:\\n\
p = (STU *) malloc(sizeof(STU));
scanf(\
any);
q->next = p; q = p;
q->next = NULL;
}
return head;
void myadd(STU *head) /*添加记录*/ {
STU *p;
p = (STU *) malloc(sizeof(STU));
printf(\请输入:电话号码姓名性别单位:\\n\
scanf(\
pany); }
void mydelete(STU *head,char name[20]) /*删除记录*/ {
STU *p,*q; q = head; p = head->next; while(p!=NULL) {
if(strcmp(p->name,name)==0) p->next=head->next; head->next = p;
}
}
{ } q = p;
q->next = p->next; free(p); break;
p = p->next;
return;
STU *mysearch(STU *head,char name[20]) /*查找记录*/ {
STU *p; p = head->next; while(p!=NULL) { } return p;
if(strcmp(p->name,name)==0) break;
p = p->next;
}
void mydisplay(STU *head) /*显示记录*/ {
printf(\%s %s %s\\n\STU *p; p = head->next; while(p!=NULL) {
ompany); }
void displaymenu( ) /*显示菜单*/ {
system(\
printf(\printf(\ 1. 创建通讯录\\n\printf(\ 2. 添加通讯录\\n\printf(\ 3. 查找通讯录\\n\ }
p = p->next;