链表保存到文本文档时,首行出现0和一串数字 ,其他正常,如何修改代码,请别删
void save(struct student *head){ struct student *p;
FILE *f;
if((f=fopen("D:\\information management.txt","a"))==NULL)
{ printf("file open error!\n");
exit(0);
}
for(p=head; p!=NULL; p=p->next)
{
fprintf(f,"%d %s %d %s %s %s \n",p->num,p->name,p->age,p->birthday,p->address,p->telephone);
}
fclose(f);
}