title: how to properly delete a pointer to array
body: <p>I'm new to C++, and I'm confused about arrays and pointers. Could someone tell me how I can properly delete a pointer. Like for example,</p>
  
  <pre><code>int *foo;
  foo = new int[10];
  
  delete foo;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>delete [] foo;
  </code></pre>
  
  <p>Thanks.</p>