#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<malloc.h>
#include<conio.h>
typedef struct Information
{
int iId; //编号
char name[10]; //姓名
char number[20]; //电话号码
char relationship[10]; //关系
}Information;
struct node;
typedef struct node *pnode;
struct node{
Information info;
pnode link;
};
typedef struct node *linklist;
linklist createnulllist_link(void)
{
linklist llist=(linklist)malloc(sizeof(struct node));
if(llist!=NULL)llist->link=NULL;
else printf("创建失败 \n");
return llist;
}
int isnulllist_link(linklist llist)
{
return(llist->link==NULL);
}
pnode locate_linkname(linklist llist)
{
pnode p;
char name[13];
if(llist==NULL)
{
printf("单链表为空");return NULL;
}
printf("请输入要查询联系人的姓名\n");
scanf("%s",&name);
p=llist->link;
while((p!=NULL)&&(strcmp(p->info.name,name)))
p=p->link;
return p;
}
pnode locate_linkrelationship(linklist llist)
{
pnode p;
char relationship[13];
if(llist==NULL)
{
printf("单链表为空");
return NULL;
}