void save(struct teacher *head)
{
struct teacher *p1=head;
FILE *fp;
if((fp=fopen("D:teacher_list.dat","r"))==NULL)
{
printf("文件不存在\n");
return ;
}
for(p1;p1!=NULL;p1=p1->next)
{
fprintf(fp,"%d %s %d %d %d %d %d",p1->num,p1->name,p1->zc,p1->status,p1->yfgz,p1->kkgz,p1->sfgz);
}
fclose(fp);
fp=fopen("D:teacher_list.dat","a");
fprintf(fp," 0 0 0 0 0 0 0");
fclose(fp);
printf("文件保存成功\n");
}