设计一个程序让链表反向输出,求前辈看看下面代码哪有有关问题

设计一个程序让链表反向输出,求前辈看看下面代码哪有问题
#define N 3
#define LEN sizeof(struct list)
#define NULL 0
#include<stdio.h>
#include<stdlib.h>
struct list{
int num;
float score;
struct list *next;
};
struct list *creat();
void print(struct list *head);
void main(){
struct list *head;
head=creat();
print(head);
}
struct list *creat(){
int n=0;
struct list *head,*last,*p;
head=NULL;
p=(struct list *)malloc(LEN);
scanf("%d,%f",&p->num,&p->score);
p->next=NULL;
while(n<N){
n++;
if(n==1) head=p;
else last->next=p;
last=p;
p=(struct list *)malloc(LEN);
scanf("%d,%f",&p->num,&p->score);
p->next=NULL;
}

return(head);
}
void print(struct list *head){
struct list *p,*p2;
int i=0;
p=head;
p->next=NULL;
head=head->next;
while(head!=NULL){
p2=head;
p2->next=p;
p=p2;
head=head->next;
}
while (p!=NULL){
printf("%d\t%3.1f",p->num,p->score);
p=p->next;}
}



调试后,构造链表函数没有问题,直到输出函数,p->next=NULL,到这里发现head->next 也是NULL了 ,怎么改善?

------解决方案--------------------
兄弟,你在输出函数时,自己把head的值赋成NULL了......
C/C++ code

//这三句,自己看看
p=head;
p->next=NULL;
head=head->next;

------解决方案--------------------
void display(Link *link)
{
if (link == NULL)
{
return;
}
if (link->next != NULL)
{
Link *p = link;
link = link->next;
display(link);
cout << p->data << endl;
}
else
{
cout << link->data << endl;
}
}