title: Find the sum in 2d array with pointers in c
body: <p>I have tried it but i get "sum=6" and it is wrong.
  Whats is wrong with the code?
  Here is the code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define ROW 2
  #define COL 3
  
  int sum(int(*array)[3]);
  
  int main(void)
  {
      int a[ROW][COL] = { {1 , 2, 3} ,
                          {4 , 5, 6} };
      printf(" sum = %d\n", sum (a));
      return 0;
  }
  
  int sum(int(*array)[3]) 
  {
      int i,j, sum = 0;
      for (i =0; i &lt; ROW ; i ++) {
          for (j =0; j &lt; COL ; j ++) {
              sum = sum + *(*( array +i )+j);
          }
      }
  }
  </code></pre>