//LIST *delist(LIST *head,int num)
LIST *delist(LIST **head,int num) //<<<<******** 注意参数形式
{LIST *p1,*p2;
if( NULL==*head ) //if( NULL==head ) //<<<*head
{printf("it is a null list !");
return(NULL);
}
//for( p1=head;p1->date!=num&&p1->next!=NULL;p1=p1->next )
for( p1=*head;p1->date!=num&&p1->next!=NULL;p1=p1->next ) // *head
p2=p1;
if( num==p1->date )
{
if( p1==*head ) //if( p1==head )//*head
{*head=p1->next;} //{head=p1->next;}//<<<<<***** *head!!!!!
else
{p2->next=p1->next;}
}
else
{printf("NOT FOUND DATE");}
return(*head );//*head
}
//// 调用时要把首结点指针的地址传进去 调用方法: delist(&head, 5);