#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
int main() {
FILE* f = fopen("test.txt", "r");
if (f == NULL) {
perror("fopen");
return -1;
}
/*int ch = fgetc(f);*/
char ch = fgetc(f);
printf("%c\n", ch);
fseek(f, -3, SEEK_END);//ABCDERGHJKLOPE会打印出来0,向前移3位0
ch = fgetc(f);
printf("%c\n", ch);
fclose(f);
f = NULL;
system("pause");
return 0;
}
打印出来的是A 0
1729

被折叠的 条评论
为什么被折叠?



