说表是空的为什么啊!
typedef struct list{int data;
struct list *next;
}list1;
list1 *creat()
{list1 *head,*r,*new;
int vale;
printf("qing shu ru zheng shu shu ru x to jie shu\n");
scanf("%d",&vale);
if(vale==0)
{head=0;
return head;}
else{head=(list1 *)malloc(sizeof(list1));
r=head;}
while(vale!=0)
{new=(list1 *)malloc(sizeof(list1));
new->data=vale;
new->next=0;
r->next=new;
r=new;
scanf("%d",&vale);}
return head;}
list1 *q;
list1 *search(list1 *p,int y)
{ p->next=q;
if( p->next==0)
printf("lian biao wei kong \n");
else{ while(q->data!=y && q->next!=0)
q=q->next;
if(q->next!=0)
return q;
else printf("mei you zhao dao ni yao de yuan shu\n");}}
main()
{list1 *l,*t;
int i=5;
l=creat();
t=search(l,i);
printf("%d\n",t->data);}