title: Referencing one Dimension of a Two-Dimensional Array
body: <p>I have some C code that works great, but I do not understand one part of the code. In this part it passes a method two pointers to a two dimensional array with only one dimension specified.</p>
  
  <p>Here it is: </p>
  
  <pre><code>if (cmppt(pts[i*3], pts[hull*3])) 
        hull = i; 
  </code></pre>
  
  <p>the method cmppt looks like this:</p>
  
  <pre><code>inline bool cmppt(const float* a, const float* b) { 
        if (a[0] &lt; b[0]) return true;
        if (a[0] &gt; b[0]) return false; 
        if (a[2] &lt; b[2]) return true; 
        if (a[2] &gt; b[2]) return false; 
        return false; 
  } 
  </code></pre>
  
  <p>The array pts is a two-dimensional array. My question is, when the method is passed both arrays for example pts[3] and pts[0] how do I know what part of the array is it looking at? It seems that pts[0] looks at the first element of the first dimension of the array and pts[3] look at the second element of the first dimension of the array, but this doesn't make sense.</p>
  
  <p>Thank you</p>