I am writing 0 to 255 ascii character and trying to read it character by characte but cant read after 25th character
<p>Here is the code snippet:</p>

<pre><code>int main()
{
  char ch=26;
  ofstream fout;
  fout.open("key.txt");
  if (fout.is_open())
  {
    for(int i=0; i&lt;256; i++)
    {
      ch=i;
      fout &lt;&lt; ch;
      cout&lt;&lt;ch;
    }
    fout.close();
  }
  else
    cout &lt;&lt; "Unable to open file";
  string line;
  ifstream fout1 ("key.txt");
  if (fout1.is_open())
  {
    while (fout1)
    {
      fout1.get(ch);
      cout &lt;&lt;" "&lt;&lt; (int)ch&lt;&lt;" "&lt;&lt;ch&lt;&lt;"\t ";
    }
    fout1.close();
  }
  else
    cout &lt;&lt; "Unable to open file";
  return 0;
}
</code></pre>

<p>I found out that while reading 26th character it stops program. If it is escaped then all others are read. Note I am using Code Blocks IDE.</p>
