Deallocation of an array of objects?
<p>I'm having some issues deallocating arrays of a class I have. Below is the Class, a simplified implementation and my code I have tried to use to close it.</p>

<p>Characters class</p>

<pre><code>#include &lt;cstdlib&gt;


class Character
{
   private:

      bool human;
      int Xposition;  // the character's postion on the board.
      int Yposition;  // the character's postion on the board.
      bool alive;


   public:

            Character();     //This is my constructor
      ~Character();  //This is my destructor
      bool isHuman();  //return whether type 1 aka Human
      bool isZombie(); //return whether type 2 aka Zombie
      void setHuman(); //set to type 1 or Human
      void setZombie(); //set to type 2 or Zombie
      void setPos(int xpos, int ypos);  //set the board position
      int X(); 
      int Y();
      bool isAlive();  //checks to see if a Human is still alive and to be displayed
      bool Dead();  //kills the character and sets alive to false
      int num_moves_allowed; //number of moves allowed.


};
</code></pre>

<p>Allocation code:</p>

<pre><code>Character *characters[11];
int human_count = 0;

for(int i=0; i&lt;12; i++)
{
    characters[human_count] = new Character();
    human_count++;
}
</code></pre>

<p>Termination code:</p>

<pre><code>for(i=11;i&lt;=0;i--)
    {
     if(characters) 
     {
      characters[i]-&gt;~Character();
      delete characters[i]; characters[i] = NULL;
     }

    }
    if(characters) 
    {
            //ERROR IS HERE
      delete [] characters;
    }
</code></pre>

<p>I have tried a number of different "delete" commands on the array and I keep getting an "Debug Assertion Failed!" window.  It says that the dbgdel.cpp from visual studio vctools is the problem place on Line 52.<br />
It also says "Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)</p>

<p>Someone please help me I'm sure this is very simple.</p>
