title: how to Clean up(destructor) a dynamic Array of pointers?
body: <p>Is that Destructor is enough or do I have to iterate to delete the new nodes??</p>
  
  <pre><code>#include "stdafx.h"  
  #include&lt;iostream&gt;  
  using namespace std;  
  struct node{  
      int row;  
      int col;  
      int value;  
      node* next_in_row;  
      node* next_in_col;  
  };  
  
  class MultiLinkedListSparseArray {  
  private:  
      char *logfile;  
      node** rowPtr;  
      node** colPtr; // used in constructor  
      node* find_node(node* out);  
      node* ins_node(node* ins,int col);  
      node* in_node(node* ins,node* z);  
      node* get(node* in,int row,int col);  
      bool exist(node* so,int row,int col);  
      //add anything you need
  public:  
      MultiLinkedListSparseArray(int rows, int cols);  
      ~MultiLinkedListSparseArray();  
      void setCell(int row, int col, int value);  
      int getCell(int row, int col);  
      void display();  
      void log(char *s);  
      void dump();  
  };  
  
  MultiLinkedListSparseArray::MultiLinkedListSparseArray(int rows,int cols){  
      rowPtr=new node* [rows+1];  
      colPtr=new node* [cols+1];  
      for(int n=0;n&lt;=rows;n++)  
          rowPtr[n]=NULL;  
      for(int i=0;i&lt;=cols;i++)  
          colPtr[i]=NULL;  
  }  
  
  MultiLinkedListSparseArray::~MultiLinkedListSparseArray(){ // is that destructor enough??  
      cout&lt;&lt;"array is deleted"&lt;&lt;endl;  
      delete [] rowPtr;  
      delete [] colPtr;  
  }  
  </code></pre>