Reading file: feof () for binary files

I am reading a binary file. and when he reaches the end. it seems to be interrupted by the feof () function. Is it because there is no EOF character for binaries? if so, how can I solve it.

Currently my code uses a while loop

while (!feof(f))

when it reaches the end of the file at position 5526900. it does not stop. he is just trying to read, and I'm stuck in a loop.

can someone tell me why and how to solve it.

thank

+3
source share
1 answer

feof() - fread() - , . , . Feof() EOF , , .

, , feof() ( eof() ++) , , , .

+22

Source: https://habr.com/ru/post/1753186/


All Articles