#include<stdio.h>
typedef struct
{
int id;
char name[20];
float score;
}STUDENT;
void main()
{
//写入
/STUDENT s={1001,"zhangsan",80};
FILEp=fopen("d:\student.txt","wt");
fprintf(p,"id=%d name=%s score=%f",s.id,s.name,s.score);
fclose(p);/
//读取
STUDENT s;
FILEp=fopen("d:\student.txt","rt");
fscanf(p,"id=%d name=%s score=%f",&s.id,&s.name,&s.score);
fclose(p);
}
在注释中已经将数据输入到记事本中了
那么我现在要读取并将其显示出来,为什么显示不出来,怎么改正呢?谢谢