title: Why doesn't delete destroy anything?
body: <p>I'm playing a little with memory dynamic allocation, but I don't get a point. When allocating some memory with the <code>new</code> statement, I'm supposed to be able to destroy the memory the pointer points to using <code>delete</code>.</p>
  
  <p>But when I try, this <code>delete</code> command doesn't seem to work since the space the pointer is pointing at doesn't seem to have been emptied.</p>
  
  <p>Let's take this truly basic piece of code as an example:</p>
  
  <pre><code>#include &lt;iostream&gt;  
  
  using namespace std;
  
  int main()  
  {  
      //I create a pointer-to-integer pTest, make it point to some new space,  
      // and fulfill this free space with a number;  
      int* pTest;  
      pTest = new int;  
      *(pTest) = 3;  
      cout &lt;&lt; *(pTest) &lt;&lt; endl; 
  
      // things are working well so far. Let's destroy this
      // dynamically allocated space!
      delete pTest;
  
      //OK, now I guess the data pTest pointed to has been destroyed 
      cout &lt;&lt; *(pTest) &lt;&lt; endl; // Oh... Well, I was mistaking.  
  
      return 0;  
  }  
  </code></pre>
  
  <p>Any clue ?</p>