title: How to print out 2d arrays with function in C++?
body: <p>I am trying to make a function that prints out two dimensional arrays.
  I did one that prints out 1d arrays.</p>
  
  <pre><code> #include &lt;iostream&gt;
   using namespace std;
  
  void printArray (int theArray[],int sizeOfArray);
  int main ()
  
  {
  int array1[3] = {1,3,7};
  int array2[5] = {123,5,23,2,324};
  
  printArray(array1, 3);
  printArray(array2, 5);
  
  }  
  
  void printArray (int theArray[],int sizeOfArray){
  
  
  for (int x=0; x&lt;sizeOfArray; x++) {
      cout&lt;&lt;theArray[x] &lt;&lt;" ";
  }
  cout&lt;&lt;endl;  
  }
  </code></pre>
  
  <p>I wrote these codes for printing out 2d arrays but I failed.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void printArray (int theArray[][],int sizeOfRow, int sizeOfCol);
  
  int main ()
  
  {
  int array[2][3] = {{1,3,7},{5,3,2}};
  
  printArray(array, 2,3);
  
  
  }
  
  void printArray (int theArray[][],int sizeOfRow, int sizeOfCol){
  
  
  for (int x=0; x&lt;sizeOfRow; x++) 
  
      for (int y=0; y&lt;sizeOfCol; y++) {
  
          cout&lt;&lt;theArray[x][y] &lt;&lt;" ";
  }
  cout&lt;&lt;endl;
  }
  </code></pre>
  
  <p>My compiler says array has incomplete element type 'int[]'.
  What are the right codes for printing out 2d arrays?</p>