title: Declaration of big array throws segmentation fault, but vector doesn't
body: <p>I was working on a project for my university and I discovered something strange.</p>
  
  <p>The declaration of an array of N elements (of type long long int), where N is input from the user, throws segmentation fault for large numbers.
  On the contrary, the declaration of a vector of the same number works like a charm.</p>
  
  <p>Declarations:</p>
  
  <pre><code>vector&lt;long long int&gt; A(N);
  </code></pre>
  
  <p>versus</p>
  
  <pre><code>long long int A[N];
  </code></pre>
  
  <p>I assume there is a difference in the way the information is stored in the memory, but correct me if I am wrong, I think that both arrays and vectors store their elements sequentially in order to achieve O(1) access to their elements. So what's the real difference between the two and what causes the segmentation fault?</p>