C++ file read fails after 685 successes
<p>I'm working on a piece of C++ through which I read a file.  Currently there are only two places (inside a function) where the file is being read from using the .get() method.</p>

<p><strong>1)</strong> The first place is rarely used (in all about six times)</p>

<p><strong>2)</strong> The second place is heavily used.  I have a for loop with the .get() method called inside, instead of the .ignore() method (with no loop) - I wanted to quantify how many times I could read from the file before the file failed.</p>

<p>I added a variable which incremented every single time the .get() method was called.  It always fails on the 685th call for some reason.</p>

<p><strong>Additionally</strong>, if I eliminate the second place, calling the .get() method once I've .ignore()'d  past the 684th character will still cause the file to fail.  So it isn't the amount of times .get() is called that is causing the fail - its the place in the file being read from.</p>

<p>There is absolutely NO WAY it could have reached the EOF.  685 characters is &lt; 1% of the file.</p>

<p>I checked the 685 character in the file with a hex editor and there didn't seem to be anything special or remarkable about it.</p>

<p>So why is the file failing?  I don't want to show you the exact code, but if you need clarification I can try to elaborate a little more, as I realize this is still a little vague.</p>

<p>Thanks in advance.</p>
