#include"hot.h"void saves(){struct student *p=shead; FILE *fp=0; if((fp=fopen(filenames,"wb+"))==NULL) {printf("The file is wrong"); getchar(); exit(0); } for(;p!=0;p=p->next) fwrite(p,N,1,fp); fclose(fp); sn=1;printf("%d",sn);
}#include"hot.h"void loads(){struct student *p,*p1; char a; FILE *fp=0; if((fp=fopen(filenames,"rb"))==0) {printf("The file is wrong"); getchar(); exit(0); } sheadl=p=(struct student *)malloc(N); fread(p,N,1,fp); while(!feof(fp)) {p1=(struct student *)malloc(N); p->next=p1; fread(p1,N,1,fp); p=p1; } fclose(fp); p->next=0; printf("name number class major tel age birthday adress QQ\n"); printf("%-11s%-7s%-6s%-6s%-13s%-4d%4d.%02d.%-3d%-7s%-11s\n",p->name,p->number,p->class,p->major,p->tel,p->age,p->birthday.year,p->birthday.month,p->birthday.day,p->adr,p->qq); printf("--------------------------------------------------------------------------------\n");; printf("Do your want to make it be the input information(Y or N)?\n"); scanf("%c",&a); if(a=='Y'||a=='y')shead=sheadl; getchar(); }
}#include"hot.h"void loads(){struct student *p,*p1; char a; FILE *fp=0; if((fp=fopen(filenames,"rb"))==0) {printf("The file is wrong"); getchar(); exit(0); } sheadl=p=(struct student *)malloc(N); fread(p,N,1,fp); while(!feof(fp)) {p1=(struct student *)malloc(N); p->next=p1; fread(p1,N,1,fp); p=p1; } fclose(fp); p->next=0; printf("name number class major tel age birthday adress QQ\n"); printf("%-11s%-7s%-6s%-6s%-13s%-4d%4d.%02d.%-3d%-7s%-11s\n",p->name,p->number,p->class,p->major,p->tel,p->age,p->birthday.year,p->birthday.month,p->birthday.day,p->adr,p->qq); printf("--------------------------------------------------------------------------------\n");; printf("Do your want to make it be the input information(Y or N)?\n"); scanf("%c",&a); if(a=='Y'||a=='y')shead=sheadl; getchar(); }