gta5恐怖彩蛋:请问以下的链表是什么意思?

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/28 11:08:20
/* 构造链表 */
struct node *makelist(char *fname)
{
FILE *fp;
struct student s;
struct node *p,*u,*v,*h;
int i;
if((fp=fopen(fname,"r"))==NULL)
{
printf("Can't open file %s.\n",fname);
return NULL;
}
h=NULL;
p=(struct node *)malloc(sizeof(struct node));
while(readrecord(fp,(struct record *)p)!=0)
{
v=h;
while(v&&p->total<=v->total)
{
u=v;
v=v->next;
}
if(v==h)
h=p;
else
u->next=p;
p->next=v;
p=(struct node *)malloc(sizeof(struct node));
}
free(p);
fclose(fp);
return h;
}