Increasing the size of array creates some problem
<p>I tried to check, what is the largest size of array, which can be created in CPP. I declared a "int" array and kept increasing the array size. After 10^9 the program started crashing, but there was a serious error for array of size 5*10^8 and more(even when program did not crash). The code used and the problem is following :</p>

<pre><code>#include&lt;iostream&gt;
int ar[500000000];
int main()
{
    printf("Here\n");
}
</code></pre>

<p>The above code runs successfully, if the size of array is reduced to 4*10^8 and lesser. But, for array size greater than 5*10^8, the program runs successfully but it does not print any thing, also it does not get crashed, or gave any error or warning.</p>

<p>Also, if the array definition is local then there is no such error, after same limit the program gets crashed. It's when using the global definition of array, the program does not get crashed nor does print anything.</p>

<p>Can anybody please explain the reason for this behavior. I've understood that the size of array will vary for different machines.</p>

<p><b>I've 1.2 GB of free RAM. How am I able to create the local integer array of size 4*10^8. This requires around 1.49GB, and I don't have that much free RAM.</b></p>
