How to rotate a matrix to 90 degrees?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/42519/how-do-you-rotate-a-two-dimensional-array">How do you rotate a two dimensional array?</a>  </p>
</blockquote>



<p>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</p>

<pre><code> # define D 9

int Ta [D][D];
short i, j;
short c=1;

for ( i=0; i &lt; D ; i++)  {
    for ( j = 0 ;  j &lt; D; j++)


    if ((j&gt;i) &amp;&amp; (j&lt;D-i-1))  Ta[i][j]=c++; 
    else if((j&gt;D-i-1) &amp;&amp; (j&lt;i)) Ta[i][j]=c++;
        else Ta[i][j]=0;  

}

for ( i = 0; i &lt; D; i++) {
    for ( j= 0; j &lt; D; j++) {
        printf("%3d",Ta[i][j]);
    }
    printf("\n");
}
</code></pre>
