title: Large arrays on local variables work on Linux but not on Windows
body: <p>A program includes two large arrays on a function (<code>main</code>):</p>
  
  <pre class="lang-cpp prettyprint-override"><code>int array [1000][1000];
  char anotherArray [1000][1000];
  </code></pre>
  
  <p>On Linux, it seems to work perfectly fine but on Windows the program crashes unless these arrays are moved to global scope.</p>
  
  <p>It seems to be an OS-specific issue, what causes it?</p>
  
  <p>Edit: this question is about the differences between both OSs</p>
  
  <h1>Answer</h1>
  
  <p><em>(as the question has been marked as duplicate, I can't answer it directly)</em></p>
  
  <p>The reason is that the stack is used for local variables (as explained on the other answers on Stack Overflow); on Windows its size is 1 MB but on Linux it's 8 MB by default, so there's more space available.</p>