title: ifstream buffer limit/overflow? C++ (_cnt?)
body: <p>For some odd reason, when my file gets too big in bytes, this error occurs where it stops reading in the correct data. It's as if the buffer stops taking in data at a certain point.</p>
  
  <p>I simplified my code as much as possible to determine the problem, but I've come to realization that it isn't my code, but perhaps a buffer somewhere?</p>
  
  <hr>
  
  <p>If my file is 14,034 bytes and I run this simple code:</p>
  
  <pre><code>ifstream inFile("text.txt"); //File is 14,034 bytes
  char test;
  
  
  while(inFile &gt;&gt; test) //This will stop looping at about the 768 - 769 loop
      cout &lt;&lt; test;
  </code></pre>
  
  <p>If I force it to go further with a for loop, the results are the same:</p>
  
  <pre><code>ifstream inFile("text.txt"); //File is 14,034 bytes
  char test;
  
  for(int count = 0; count &lt; 14034; ++count) //The loop will continue until the
      test = inFile.get();                   //end, but for whatever reason, 
      cout &lt;&lt; test;                          //inFile stops at 768 - 769 again
  </code></pre>
  
  <hr>
  
  <p>NOW: if I use the same code, but for a smaller file(say 900 bytes), I don't seem to have 
  that problem.</p>
  
  <p><em>EXACT SAME CODE, JUST DIFFERENT FILE SIZE</em></p>
  
  <pre><code>ifstream inFile("text.txt"); //File is 900 bytes
  char test;
  
  while(inFile &gt;&gt; test) //This loop will continue to the 900th loop without 
      cout &lt;&lt; test;     //problems.
  </code></pre>
  
  <p><em>EXACT SAME CODE, JUST DIFFERENT FILE SIZE</em></p>
  
  <pre><code>ifstream inFile("text.txt"); //File is 900 bytes
  char test;
  
  for(int count = 0; count &lt; 900; ++count) //The loop will continue until the
      test = inFile.get();                 //end (900) without problems.
      cout &lt;&lt; test;
  </code></pre>
  
  <hr>
  
  <p>I've searched for my problem all over Google, and haven't been able to find a solution. The only other thread I found with a similar problem is this one:</p>
  
  <p><a href="https://stackoverflow.com/questions/4714679/fopen-cant-write-more-than-16k">fopen - can&#39;t write more than 16K?</a></p>
  
  <p>But even then, no one really understood what they were talking about - so the question was technically unanswered.</p>