<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[array 4x4 über die diagonale spiegeln aber wie]]></title><description><![CDATA[<p>guten tag anfänger in c++</p>
<p>ich hab ein vektor array bestehend aus 4x4 zahlen<br />
bsp<br />
1 2 3 4<br />
3 4 5 6<br />
7 8 9 0<br />
2 3 8 7</p>
<p>das soll gespiegelt werden DUIAGONAL</p>
<p>also zu</p>
<p>1 3 7 5<br />
2 4 8 3<br />
3 5 9 8<br />
4 6 0 7</p>
<p>matrix_1[i][j] heist das array</p>
<p>fit den for schleifen wird das ja dann wieder zurückgedreht</p>
<p>for (i=0;i&lt;4;i++)<br />
for (j=0;j&lt;4;j++)<br />
** matrix i j in tmp<br />
matrix I J = matrix j I<br />
matrix j i = tmp</p>
<p>so gehts auf keinen fall</p>
<p>wier kann man das elegant lösen</p>
<p>danke bin anfänger bitte nicht über pointer</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/150261/array-4x4-über-die-diagonale-spiegeln-aber-wie</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 13:44:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/150261.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Jun 2006 15:09:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to array 4x4 über die diagonale spiegeln aber wie on Wed, 14 Jun 2006 15:12:03 GMT]]></title><description><![CDATA[<p>guten tag anfänger in c++</p>
<p>ich hab ein vektor array bestehend aus 4x4 zahlen<br />
bsp<br />
1 2 3 4<br />
3 4 5 6<br />
7 8 9 0<br />
2 3 8 7</p>
<p>das soll gespiegelt werden DUIAGONAL</p>
<p>also zu</p>
<p>1 3 7 5<br />
2 4 8 3<br />
3 5 9 8<br />
4 6 0 7</p>
<p>matrix_1[i][j] heist das array</p>
<p>fit den for schleifen wird das ja dann wieder zurückgedreht</p>
<p>for (i=0;i&lt;4;i++)<br />
for (j=0;j&lt;4;j++)<br />
** matrix i j in tmp<br />
matrix I J = matrix j I<br />
matrix j i = tmp</p>
<p>so gehts auf keinen fall</p>
<p>wier kann man das elegant lösen</p>
<p>danke bin anfänger bitte nicht über pointer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1077707</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1077707</guid><dc:creator><![CDATA[magic33]]></dc:creator><pubDate>Wed, 14 Jun 2006 15:12:03 GMT</pubDate></item><item><title><![CDATA[Reply to array 4x4 über die diagonale spiegeln aber wie on Wed, 14 Jun 2006 15:32:06 GMT]]></title><description><![CDATA[<p>Am simpelsten sind wohl hartcodierte 6 swaps zum transponieren. Ansonsten ist die Idee mit der Schleife nicht verkehrt, da sie sich auf beliebig große quadratische Matrizen erweitern lässt.</p>
<pre><code class="language-cpp">for(int i = 1; i != 4; ++i)
  for(int j=0; j != i; ++j)
    std::swap(matrix[i][j], matrix[j][i]);
</code></pre>
<p>edit: ungetestet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1077728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1077728</guid><dc:creator><![CDATA[Walli]]></dc:creator><pubDate>Wed, 14 Jun 2006 15:32:06 GMT</pubDate></item><item><title><![CDATA[Reply to array 4x4 über die diagonale spiegeln aber wie on Thu, 15 Jun 2006 07:08:01 GMT]]></title><description><![CDATA[<p>Walli schrieb:</p>
<blockquote>
<p>Am simpelsten sind wohl hartcodierte 6 swaps zum transponieren. Ansonsten ist die Idee mit der Schleife nicht verkehrt, da sie sich auf beliebig große quadratische Matrizen erweitern lässt.</p>
<pre><code class="language-cpp">for(int i = 1; i != 4; ++i)
  for(int j=0; j != i; ++j)
    std::swap(matrix[i][j], matrix[j][i]);
</code></pre>
<p>edit: ungetestet.</p>
</blockquote>
<p>danke das wars was ich gesucht hatte</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1077953</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1077953</guid><dc:creator><![CDATA[magic33]]></dc:creator><pubDate>Thu, 15 Jun 2006 07:08:01 GMT</pubDate></item></channel></rss>