📄 readdata.c
字号:
#include "Score.h"
void ReadData(Student stu[] , int count)
{
FILE *fp;
int i;
char ch[10];
if((fp = fopen("Score.dat","r")) == NULL)
{
printf("\tCan't open the file: Score.dat.\n\tPress AnyKey to Exit... ");
getch();
exit(0);
}
fscanf(fp,"%s%s%s%s%s",ch,ch,ch,ch,ch);
for(i = 0 ; i < count ; i++)
fscanf(fp,"%s%s%d%d%d",stu[i].id,stu[i].name,&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -