全文预览

c语言学生成绩管理系统课程设计报告

上传者:幸福人生 |  格式:doc  |  页数:34 |  大小:997KB

文档介绍
;Рinput(p1);flag=1;Рp2->next=NULL;Рreturn (head);Рstruct student *load(void);Рstruct student *p1,*p2,*head=NULL;РFILE *fp;РYРNРfp=fopen("student.dat","rb"))==NULLРprintf("fail to open the file!!\n");Рreturn (0);Рprintf("loading...\n");Рp1=(struct student *)malloc(LEN);РYРNР!p1?Рprintf("out of memory!\nРgetch();return(0);Рhead=p1Рwhile(!feof(fp))РNРYРfread(p1,LEN,1,fp)!=1?Рbreak;Рp1->next=(struct student *)malloc(LEN);РNРYР!p1->next/Рprintf("Out of memory!\n");Рreturn (head);Рp2=p1; p1=p1->next;Рp2->next=NULL; fclose(fp);Рreturn (head);Рvoid save(struct student *);РFILE *fp; struct student *p;РNРfp=fopen("student.dat","wb"))==NULL?Р YРprintf("fail to open the file!\n");Рgetch();return;Рp=head;Рwhile(p!=NULL)Рfwrite(p,LEN,1,fp); p=p->next; fclose(fp);Рstruct student *findw(struct student *);

收藏

分享

举报
下载此文档