title: 2D array and pointer in C - how to access elements?
body: <p>I have an example involving a pointer to a 2D array. Can someone help me understand what is going on in this example? </p>
  
  <pre><code>int main()
  {
  
      int i = 0, j=0, sum0=0, sum1=0;
      int data[4][3] = { {23,55,50},{45,38,55},{70,43,45},{34,46,60}};
      int *Ptr;
      Ptr = *data;    //Why is the indirection operator used here? 
                      // Does Ptr = 23 by this assignment?
  
      for (i=0; i&lt;4; i++) {
          sum1 = 0;
          for (j = 0; j &lt; 3; j++) {
              sum1 += data[i][j];
          }
          if (sum1 &gt; sum0) {
                   sum0 = sum1;
                   Ptr = *(data + i);     // Seems like this statement makes Ptr
          }                               // point one row below ... what syntax
      }                                   // can you use to access columns then?
                                         // Is it possible to use pointer arithmetic
      for (i=0; i&lt;3; i++)                 // to access elements of data[i][j] that
          printf("%d\n", Ptr[i]);          // are not at j = 0?
  
    return 0;
  }
  </code></pre>