void del_data(struct family *head)//删除函数
{ struct family *p1,*p2;
int year,month;
if(head==NULL) printf("kong\n");
else
{
p1=head;
printf("输入要删除的年:\n");
scanf("%d",&year);
printf("输入要删除的月:\n");
scanf("%d",&month);
while(p1->next!=NULL&&strcmp(year,p1->year)!=0) //判断是否存在要删除的信息
while(p1->next!=NULL&&strcmp(month,p1->month)!=0)
{
p2=p1;
p1=p1->next;
}
if( strcmp(year,p1->year)==0)
{
if(p1==head)
head=p1->next;
else
p2->next=p1->next;
}
else
printf("查无此信息\n");
}
free(p1);