void foo(int a[6][6])
{
int i, swap[6];
for (i = 0; i < 3; ++i)
{
memcpy(swap, a[i], sizeof swap);
memcpy(a[i], a[5 - i], sizeof swap);
memcpy(a[5 - i], swap, sizeof swap);
}
}
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
@kalai: click on the code tag icon in the editing window, and paste your code in between the code tags. Makes your code easy to read and study, and not look like html text and all squished to the left hand margin.
Adak
Nearly a Posting Virtuoso
1,479 posts since Jun 2008
Reputation Points: 425
Solved Threads: 185