title: C++ raw pointers and "delete"
body: <p><br/>
  I have a question regarding the code snippet below:</p>
  
  <pre><code>double d = 20.1;
  double* pd = new double;
  ...
  pd = &amp;d;
  delete pd;
  </code></pre>
  
  <p>The last line throws an error in Visual C++ 2015. Does this mean that the pointer "<code>pd</code>" points to the stack address of "<code>d</code>" and its original pointed-to address in the heap (right-hand side of the equal sign in the second line) has leaked?</p>