title: Correct way of passing 2 dimensional array into a function
body: <p>I have a 2-dimensional array and I am passing it into a function to carry out certain operations.  I'd like to know the correct way of doing it...</p>
  
  <pre><code>#define numRows 3
  #define numCols 7
  #define TotalNum (numRows*numCols)
  int arr[numRows][numCols] = {{0,1,2,3,4,5,6}, {7,8,9,10,11,12,13},{14,15,16,17,18,19,20}};
  
  void display(int **p)
  {
      printf("\n");
      for (int i = 0; i&lt; numRows;i++)
      {
          for ( int j = 0;j&lt; numCols;j++)
          {
              printf("%i\t",p[i][j]);
          }
          printf("\n");
      }
  }
  
  int main() {
      display(arr);
  }
  </code></pre>
  
  <p>I get an error message:</p>
  
  <pre><code>'display': cannot convert parameter1 from 'int' to 'int*'
  </code></pre>
  
  <p>Is this the correct way of passing a 2-dimensional array into a function?  If not, what is the correct way?</p>