帮忙找下错误!!
#include "stdio.h"#define NULL 0
struct student
{
int num;
float score;
struct student *next;
};
struct student *body()
{
struct student a,b,c,*head;
a.num=1;
a.score=89.5;
b.num=2;
b.score=90;
c.num=3;
c.score=78.5;
head->next=&a;
a.next=&b;
b.next=&c;
c.next=NULL;
return(head);
}
void main()
{
struct student *head, *p;
head=body();
p=head->next;
while(p!=NULL)
{
printf("%d %.2f\n",p->num,p->score);
p=p->next;
}
}