title: C++: Pointers and scope
body: <pre><code>int* test( )
  {
      int a = 5;
      int* b = &amp;a;
      return b;
  }
  </code></pre>
  
  <p>Will the result of <code>test</code> be a <code>bad pointer</code>? As far as I know a should be deleted and then <code>b</code> would become a messed up pointer, right?</p>
  
  <p>How about more complicated things, not an int pointer but the same with a class with 20 members or so?</p>