Under linux, the two fgetc() will return the same character "#". But under Windows the second fgetc() returns EOF. Why is that happen?Code:#include <stdio.h> int main() { FILE* fp = fopen("main.c", "r"); fputc(fgetc(fp), stdout); fseek(fp, -1, SEEK_CUR); fputc(fgetc(fp), stdout); return 0; }
BTW, if I change the code to fseek(fp, 0, SEEK_CUR), Linux returns two different characters "#" and "i" while windows returns two "#".