Array declared within main throws stack overflow, declared outside main does not
<p>I have the below code:</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;cstdio&gt;
using namespace std;
int main(){
    int pnp[2][105],fin[2][105];
    int time[105],n,m,dummy,prod = 0;
    int const maxvv = 2000000;
    int d[maxvv];
    return 0;
}
</code></pre>

<p>I get a stackoverflow at <code>int d[maxvv]</code>. However, if I shift to the global scope</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;cstdio&gt;
using namespace std;
int const maxvv = 2000000;
int d[maxvv];
int main(){
    int pnp[2][105],fin[2][105];
    int time[105],n,m,dummy,prod = 0;

    return 0;
}
</code></pre>

<p>I do not get this error. Can anybody tell me what is the difference. Using vs 2008 with c++ on windows 7</p>
