Difference between an array and vector related to maximum size?
<p>When i run this code in my Devcpp compiler-></p>

<pre><code>#include&lt;bits/stdc++.h&gt;
using namespace std;
int main()
{
    vector&lt;int&gt; vec;
    for(int i=0;i&lt;100000000;i++)
    vec.push_back(i);
}
</code></pre>

<p>It works even on run time.
But when i run-></p>

<pre><code>#include&lt;bits/stdc++.h&gt;
using namespace std;
int arr[1000000000];
int main()
{
    return 0;
}
</code></pre>

<p>It gives me link error.</p>

<p>As long as space is required both arr and vec requires the same space.Then why is it that vec code runs even fine on run time but arr code doesnt even compile.</p>