typedef struct Student{
char name[21];
int age;
float score;
} STUDENT;
STUDENT stu[3] =
{{"哈哈",20,99.0f},{"呵呵",23,98.0f},{"嘿嘿",22,97.0f}};
//创建文件指针
FILE *fp = fopen("student.date", "wb+");
if (fp != NULL) {
//循环写入
for (int i = 0; i < 3; i++) {
fwrite(&stu[i], sizeof(STUDENT), 1, fp);
}
Log("写入成功\n");
}
fseek(fp, sizeof(STUDENT), SEEK_END);
STUDENT stu3;
现在我想从末尾开始往上读怎么弄?
|
|