For example this data file abc.txt
abc
Note that there is no newline at the bottom.
When I write the following program in C
#include <stdio.h>
int main(){
FILE *fp = fopen("abc.txt","rb"); // NOTE this is "rb"
while (!feof(fp)){
fprintf(stdout, "%c", fgetc(fp));
fprintf(stdout, "%d", feof(fp));
}
fclose(fp);
return 0;
}
The stdout result is like this:
[xxx@xxx hello]$ ./a.out
a0b0c0
0�1[xxx@xxx hello]$
What is the additional output bytes in the last line?