求高手看下代码问题错在哪!
struct student *And(struct student *h1,struct student *h2){
struct student *pa,*pb,*pc,*t,*c,*head3;
pa=h1;
t=h2;
pc=(struct student *)malloc(sizeof(LEN));
head3=pc;
pc->next=NULL;
pc->num=0;
while(pa!=NULL)
{
t=pb;
while(pb!=NULL)
{
if(pa->num==pb->num)
{
c=(struct student *)malloc(sizeof(LEN));
c->next=NULL;
c->num=pa->num;
pc->next=c;
pc=c;
pa=pa->next;
}
pb=pb->next;
}
pa=pa->next;
}
return head3;
}