此部分函数如下
void draw()
{
mess *p;
system("cls");
fp=fopen("d:\\stu.txt","rb+"); //<<--
if(fp==NULL)
{
printf("打开失败,文件不存在。\n");
fclose(fp);
system("pause");
system("cls");
return;
}
fseek(fp,0,SEEK_SET);
while(!feof(fp))
{
p=(mess*)malloc(sizeof(mess));
fscanf(fp,"%ld %s %s %d %d %s %s %s",
&p->number,p->name,p->sex,&p->year,&p->month,p->add,
p->phone,p->mail);
p->next=head;
head=p;
}
fclose(fp);
system("pause");
system("cls");
return;
}
```![图片说明](https://img-ask.csdn.net/upload/202003/03/1583227121_433753.png)