title: C/C++ overwriting array bounds
body: <p>What is a good way to detect bugs where I overwrite an array bound?</p>
  
  <pre><code>int a[100];
  for (int i = 0; i&lt;1000; i++) a[i] = i;
  </code></pre>
  
  <p>It would be helpful to collect a list of different strategies that people have used in their experience to uncover bugs of this type.
  For example, doing a backtrace on from the point of the memory fault (for me often this doesn't work because the stack has been corrupted).</p>