title: Trying to swap the elements of a two dimensional array in C
body: <p>I am writing a method that swaps the elements of a two dimensional array.  I have looked for answers to this, but there don't seem to be many good answers for this kind of swapping.  The main difference from traditional swapping is that I am not trying to swap the integers within one of the length 2 array but instead trying to swap a pair of the length 2 arrays, more specifically their pointers.  I am pretty new to C (trying to switch from Java).  When I compile the code below, I receive a warning "assignment makes integer from pointer without a cast".  Any help would be greatly appreciated.  Thanks in advance.</p>
  
  <pre><code>void swap(int array[][2], int indexA, int indexB)
  {
      int *temp = array[indexA];
      *array[indexA] = array[indexB];
      *array[indexB] = temp;
  }
  </code></pre>
  
  <p>Edit: I also tried the code below to replace the last two lines (not including the brackets, but that caused the compiler to give the error "incompatible types when assigning to type ‘int[2]’ from type ‘int *’" for each of those lines.</p>
  
  <pre><code>array[indexA] = array[indexB];
  array[indexB] = temp;
  </code></pre>
  
  <p>Edit: The array declaration is below and the the swap function gets called as part of a quicksort implementation.  The sort method that is calling the swap method uses the same type of argument declaration as the one I used in swap (i.e. "int array[][2]).</p>
  
  <pre><code>int counts[256][2];
  </code></pre>