求看看这个链表有哪里不妥
这个函数可以运行,但是其他的函数调用不了这个函数里提到的stuliststu* inputInfo(stu * stulist ){
int i , stu_num;
stu * pO =NULL, * pN =NULL ;
printf("The number of the students that your want to input\n");
scanf("%d" , &stu_num);
while(stu_num>20||stu_num<=0){ /*控制输入信息的学生个数*/
printf("The system can at most hold 20 student, please reinput\n");
stu_num=GetInteger();
}
for(i=1; i<=stu_num ; i++){
pN = (stu * )malloc(sizeof(struct stu));
if (stulist==NULL) {/*判断是否是第一次输入*/
stulist=pN; /*定义头指针*/
}
else {
pO->next=pN; /*使其链接到下一个结构体*/
}
pN->next=NULL; /*每一个结构体都可能是最后一个,所以将现在的结构体中指向下一个结构体的指针定为空指针*/
printf("Please input the student's id\n");
scanf("%d" , &pN->stu_id);
while(uniqueNumber(stulist,pN->stu_id)==1){
printf("The ID you put in is already there,please reinput\n");
strcpy(pN->stu_id,GetInteger());
}
printf("Please input the student's name\n");
scanf("%s" ,& pN->name);
printf("Please input the student's score\n");
scanf("%d" , &pN->score);
while(checkscore(pN->score)==1){
printf("The Score you put in is out of range,please keep it from 0 to 100\n");
scanf("%d" , &pN->score);
}
pO=pN;
}
return stulist;
}