title: C++ Array of pointers: delete or delete []?
body: <p>Cosider the following code:</p>
  
  <pre><code>class Foo
  {
      Monster* monsters[6];
  
      Foo()
      {
          for (int i = 0; i &lt; 6; i++)
          {
              monsters[i] = new Monster();
          }
      }
  
      virtual ~Foo();
  }
  </code></pre>
  
  <p>What is the correct destructor?</p>
  
  <p>this:</p>
  
  <pre><code>Foo::~Foo()
  {
      delete [] monsters;
  }
  </code></pre>
  
  <p>or this:</p>
  
  <pre><code>Foo::~Foo()
  {
      for (int i = 0; i &lt; 6; i++)
      {
          delete monsters[i];
      }
  }
  </code></pre>
  
  <p>I currently have the uppermost constructor and everything is working okey, but of course I cannot see if it happens to be leaking...</p>
  
  <p>Personally, I think the second version is much more logical considering what I am doing. Anyway, what is the "proper" way to do this?</p>