title: print a matrix through a pointer
body: <pre><code>int** mat = new int*[5];
  
  // define the elements to be inserted to the matrix     
  int* i1 = new int;
  *i1 = 1;
  
  int* i2 = new int;
  *i2 = 2;
  
  int* i3 = new int;
  *i3 = 3;
  
  int* i4 = new int;
  *i4 = 4;
  
  int* i5 = new int;
  *i5 = 5;
  
  // insert the elements to the matrix
  mat[0] = i1;
  mat[1] = i2;
  mat[2] = i3;
  mat[3] = i4;
  mat[4] = i5;
  </code></pre>
  
  <p>now I define the pointer. I want to print the matrix through this pointer. so I define it:</p>
  
  <pre><code>int* ptr = *mat;
  </code></pre>
  
  <p>and here I print it:</p>
  
  <pre><code>for (int i = 0; i &lt; 5; i++) {
      cout &lt;&lt; *ptr &lt;&lt; endl;
      ptr++;
  }
  </code></pre>
  
  <p>but I got:</p>
  
  <pre><code>1
  2543679
  9826
  257678
  7853
  </code></pre>
  
  <p>please remember that I want to print it through a pointer (and do it ++) so relate only to the definition of the <code>ptr</code> and the <code>for loop</code></p>