title: Why does calling 'delete' in a specific way on a dynamic array not work?
body: <p>I'm wondering why this code doesn't work:</p>
  
  <pre><code>void KeyValueList::Release()
  {
  //(m_ppKeyValueList is a dynamic array of pointers to objects on the heap)
      if (m_ppKeyValueList) {
          for (int i = 0; i &lt; m_iCapacity; ++i) {
              if (m_ppKeyValueList[i]) {
                  delete m_ppKeyValueList[i];
              }
          }
          /*delete[] m_ppKeyValueList;*/
          for (int i = 0; i &lt; m_iCapacity; ++i) {
              delete (m_ppKeyValueList + i);
          }
      }
  }
  </code></pre>
  
  <p>Why can't we iterate the dynamic array and <code>delete</code> it in this way?</p>