C语言源代码摘要.doc

C语言源代码摘要.doc

#includestdio.h #includestdlib.h #includestring.h #includeconio.h /*定义学生结构体*/ struct Student { int ID; char Name[20]; char college[20]; char CLASS[20]; int score1; int score2; int score3; float aver; }; struct Student students[100]; int num=0; int read_file() { FILE *fp; int i=0; if((fp=fopen(student.txt,rt))==NULL) { printf(\n\n*****库存文件不存在!请创建); return 0; } while(feof(fp)!=1) { fread(students[i],sizeof(students),1,fp); if(students[i].ID==0) break; else i++; } fclose(fp);

文档评论(0)

1亿VIP精品文档

相关文档