C语言初学者的一个问题
#include "stdafx.h"#include "stdio.h"#define NODE struct StuInfovoid main(){ }struct StuInfo{ int score; struct StuInfo *next;}/*typedef struct StuInfo NODE; */NODE *create() //创建链表{ NODE *head, *tail, *pnew; int score; head = (NODE *)malloc (sizeof(NODE)); //创建头节点 head->next = NULL; //头节点的指针域置NULL tail = head; //开始时尾指针指向头节点 while (1) //创建学生成绩线性链表 { scanf ("%d", &score); //输入成绩 if (score < 0) //成绩为负,循环退出 break; pnew = (NODE *)malloc (sizeof(NODE)); //创建一新节点 pnew->score = score; pnew->next = NULL; tail->next = pnew; tail = pnew; } return (head);}