title: will memory be freed to system once the program exits?
body: <p>I have understanding (probably wrong) that memory becomes free anway on application exit, so what's the point of calling delete on something that lives as long as program is running?</p>
  
  <p>for example this sample code doesn't delete a pointer:</p>
  
  <pre><code>int main()
  {
      int p = new int;
      return 0;
  }
  </code></pre>
  
  <p>will memory pointed by pointer 'p' be freed to system once the program exits?</p>