title: Passing a 3-dimensional variable size array by reference in C++
body: <p>I've been working off of <a href="https://stackoverflow.com/questions/8767166/passing-2d-array-to-function">Passing a 2D array to a C++ function</a> , as well as a few other similar articles. However, I'm running into a problem wherein the array I'm creating has two dimensions of variable size.</p>
  
  <p>The initialization looks like:</p>
  
  <pre><code>int** mulePosition;
  mulePosition = new int *[boardSize][boardSize][2];
  </code></pre>
  
  <p>The function looks like:</p>
  
  <pre><code>int moveMule (int boardSize, int ***mulePosition)
  </code></pre>
  
  <p>And the references look like</p>
  
  <pre><code>moveMule (boardSize, mulePosition)
  </code></pre>
  
  <p>Boardsize is defined at the beginning of the function, but may change per execution.
  The array, properly sized, would be int [boardSize][boardSize][2].</p>