zBuilder has correctly pointed that you are in fact trying to read a binary file in text mode. A binary file can contain all kinds of values, just not the ASCII values that a text file contains. So, a binary file can contain the value '-1' anywhere in it, not just at the end of a file. This...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.