title: Debug stack corruption
body: <p>Now I am debugging a large project, which has a stack corruption: the application fails.</p>
  
  <p>I would like to know how to find (debug) such stack corruption code with Visual Studio 2010?</p>
  
  <p>Here's an example of some code which causes stack problems, how would I find less obvious cases of this type of corruption?</p>
  
  <pre><code>void foo()
  {
      int i = 10;
      int *p = &amp;i;
      p[-2] = 100;
  }
  </code></pre>
  
  <h2>Update</h2>
  
  <p>Please note that this is just an example. I need to find such bad code in the current project.</p>