Possible Duplicate:
How do you rotate a two dimensional array?
Beginner in C++ , Need to rotate to 90 degrees, I already tried to do with the help of others posts here , but without luck. Sorry for English
# define D 9
int Ta [D][D];
short i, j;
short c=1;
for ( i=0; i < D ; i++) {
for ( j = 0 ; j < D; j++)
if ((j>i) && (j<D-i-1)) Ta[i][j]=c++;
else if((j>D-i-1) && (j<i)) Ta[i][j]=c++;
else Ta[i][j]=0;
}
for ( i = 0; i < D; i++) {
for ( j= 0; j < D; j++) {
printf("%3d",Ta[i][j]);
}
printf("\n");
}