?? exam12-11.cpp
字號(hào):
/*文件名:exam12_11.cpp*/
#include <stdio.h>
main()
{
FILE *fp;
struct student
{
char name[10];
int score;
} stud;
int i;
if ((fp=fopen("stud.bin","rb"))==NULL)
{
printf("不能讀取stud.bin文件\n");
return;
}
printf("姓名 成績\n");
printf("----------\n");
for (i=0;i<5;i++)
{
fread(&stud,sizeof(struct student),1,fp);
printf("%s %d\n",stud.name,stud.score);
}
fclose(fp);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -