Vertically/Horizontally flip a 2d array
<p>This might be considered a low-brow question. Yet, I haven't found any code, or any forums discussing how to go about this in my programming language, C. Plenty of attempt have been made, and all end up in practically "hard-coding" the new arrays. </p>

<p>I'm trying to vertically, then horizontally flip a 2d array.
It seemed easy enough, just went through systematically and manipulated each row and column value. But, what if I want to go about an array that isn't just a basic 3x3 array. Such as 11x11, or 15x15?</p>

<pre><code>**CODE SNIPPET:**

int array[3][3]= { {1,2,3},
                   {4,5,6},
                   {7,8,9} };

int vertFlip[3][3],
    horzFlip[3][3]; 

for(i = 0; i &lt; rows; i++)
{
  for(j = 0; j &lt; cols; j++)
  {
     vertFlip[0][i]= array[2][i];
     vertFlip[1][i]= array[1][i];
     vertFlip[2][i]= array[0][i];   
  }
} //and so on for horizontal, obviously my nested for loop was different. 
</code></pre>

<p>But, what if this array was something much larger, (123x123 sized array) does anyone know an effective way to accomplish this task?</p>