fgetc not starting at beginning of large txt file

后端 未结 1 2020
逝去的感伤
逝去的感伤 2021-01-26 14:04

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

相关标签:
1条回答
  • 2021-01-26 14:15

    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
    
    0 讨论(0)
提交回复
热议问题