title: cArray[][] Pointer Array Casting
body: <p>I am having trouble with a vendor API for retrieving data from a device.  A working version of the call  as suggested in the vendor docs looks something like the following:</p>
  
  <pre><code>int dataArray[15][20];
  getData(15, 20, (int*) dataArray);
  </code></pre>
  
  <p>The call signature is described as:</p>
  
  <pre><code>void getData(xSize, ySize, int*);
  </code></pre>
  
  <p>I am interested in having this function to copy data into a contiguous array of ints with a dynamic size, with something like the following:</p>
  
  <pre><code>int *flatDataArray = (int*) malloc(xSize * ySize * sizeof(int));
  </code></pre>
  
  <p>I am having a hard time getting the call right, and segfaults are somewhat difficult to debug :(</p>
  
  <p>I think my misunderstanding is around how a int array is  represented, and what happens when you cast it to (int*).  In this example is "dataArray" of type int**, or something else?  If so, would you have to construct an array of pointers into flatDataArray for the above function to work properly?  </p>