请问各位大佬,这个程序什么地方错了?小弟实在不懂
typedef struct student { char num[10]; double s; struct student *next;}list; int main(void) { list *p=NULL,*q=NULL,*head=NULL,temp={0}; char tempnum[10]=""; FILE *fp=NULL; fp=fopen("D:\\学生成绩.txt","r"); if(fp==NULL) { printf("\n 打开文件失败!\n"); exit(0); } q=head; p=head->next; printf("\n请输入需要删除的学号:\n"); scanf("%s",&tempnum); while(feof(fp)==0) fscanf(fp,"%15s%15lf\n",&temp.num,&temp.s); while(p!=NULL) if(tempnum!=p->num) { q=q->next; p=p->next; } else break; q->next=p->next; free(p); printf(" 学号 分数\n"); while(feof(fp)==0) { printf("%15s%15lf\n%",temp.num,temp.s); fprintf(fp,"%15s%15lf\n",temp.num,temp.s); } fclose(fp); }