I am working in C and have a text file that is 617kb that I am trying to read with fgetc
. For some reason fgetc
is starting randomly within the file. I
I suspect the problem lies elsewhere.
Where is the output from this program going? If you're sending it to the console, its scrollback buffer won't be large enough to contain the whole file. Maybe it just looks like fgetc()
is starting in an odd place.
Try diverting the output from this program to a new text file and compare the size of this file with the size of the input file, e.g.:
./category_print >output.txt