i am programming C on windows. i encountered this problem while trying to read a .tar.gz file.
the file looks like (opened with notepad++):
and the code i used to read is as follow:
iFile = fopen("my.tar.gz", "r");
while ((oneChar = fgetc(iFile)) != EOF) {
printf("%c", oneChar);
}
the following figure shows the result of my program:
The problem I have is, the result only has several lines while the original file has thousands of lines (6310 lines, as you can see). My guess is that the .tar.gz file contains some strange characters (like an EOF in the middle of the file?).
My question is why notepad++ can display the whole file while my program can not. And is there a solution to this problem?