title: file.exe has stopped working when opening very large file
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;conio.h&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  
  
  int main()
  {
      ifstream input("numbers.txt");
      int a[500000];
  
      if (input.is_open())
      {
          for (int i = 0; i &lt;= 499999; i = i + 50000)
          {
              input &gt;&gt; a[i];
              cout &lt;&lt; a[i] &lt;&lt; endl;
          }
      }
      else
          cout &lt;&lt; "Could not open File" &lt;&lt; endl &lt;&lt; endl;
  }
  </code></pre>
  
  <p>The file name "numbers.txt" is a simple txt file that contains exactly 500,000 integer numbers. Testing this code out on a small file of 100 integers it worked fine, but whenever I read this file is gave me the usual "file.exe has stopped working". Any idea why?</p>