title: Reallocating memory via "new" in C++
body: <p>Quick question regarding memory management in C++</p>
  
  <p>If I do the following operation:</p>
  
  <pre><code>pointer = new char [strlen(someinput_input)+1];
  </code></pre>
  
  <p>And then perform it again, with perhaps a different result being returned from <code>strlen(someinput_input)</code>.</p>
  
  <p>Does this result in memory being left allocated from the previous "<code>new</code>" statement? As in, is each <code>new</code> statement receiving another block of HEAP memory from the OS, or is it simply reallocating?</p>
  
  <p>Assuming I do a final <code>delete pointer[];</code> will that deallocate any and all memory that I ever allocated via <code>new</code> to that pointer?</p>