title: C: Function to swap values in 2D array
body: <p>I'm trying to write a function to swap 2 elements in a 2D array:</p>
  
  <pre><code>void swap(int surface[][], int x1, int y1, int x2, int y2) {
      int temp = surface[x1][y1];
      surface[x1][y1] = surface[x2][y2];
      surface[x2][y2] = temp;
  }
  </code></pre>
  
  <p>however when I try to compile it (gcc), I get this error message:</p>
  
  <pre><code>Sim_Annealing.c: In function `swap': 
  Sim_Annealing.c:7: error: invalid use of array with unspecified bounds
  Sim_Annealing.c:8: error: invalid use of array with unspecified bounds
  Sim_Annealing.c:8: error: invalid use of array with unspecified bounds
  Sim_Annealing.c:9: error: invalid use of array with unspecified bounds
  </code></pre>
  
  <p>Is there some special magic I have to do in order to have a 2D array as a function parameter?</p>
  
  <p>Thanks for your help.  If you know of any good references for arrays as function parameters send them my way :)</p>