title: Why can I set values outside of the array's range?
body: <p>From what I have read, arrays can only be a fixed size, which is defined when you create it (and if you want to create something similar with a dynamic size, you use vectors instead).</p>
  
  <p>However, when I try to set values outside of the array, I am perfectly able to:</p>
  
  <pre><code>int badNums[5] = {4, 13, 14, 24, 34};
  badNums[999] = -127;
  std::cout &lt;&lt; badNums[999] &lt;&lt; std::endl;
  // Returns -127
  </code></pre>
  
  <p>And it gets even more bizarre if I try to access values of the array outside of the fixed range:</p>
  
  <pre><code>std::cout &lt;&lt; badNums[997] &lt;&lt; std::endl;
  // Returns 825245046 (but seems to be randomly chosen every time I run it)
  </code></pre>
  
  <p>What is going on here?</p>