<?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[Range based for loop bei Matrizen]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe mir die range based for loop angesehen. Für einen Vektor ist das klar:</p>
<pre><code>vector&lt;int&gt; vec = {4,8,15,16,23,42};
for(auto j: vec){cout &lt;&lt; j &lt;&lt; &quot; &quot;;}
</code></pre>
<p>Wenn ich nun eine Vektormatrix</p>
<pre><code>vector&lt; vector&lt;int&gt; &gt; Matrix;
</code></pre>
<p>habe, ist dann eine range based for Schleife ebenfalls möglich?</p>
<p>Wenn ja wie?</p>
<p>Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/337912/range-based-for-loop-bei-matrizen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 12:20:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/337912.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 May 2016 09:32:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Range based for loop bei Matrizen on Tue, 10 May 2016 09:32:17 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe mir die range based for loop angesehen. Für einen Vektor ist das klar:</p>
<pre><code>vector&lt;int&gt; vec = {4,8,15,16,23,42};
for(auto j: vec){cout &lt;&lt; j &lt;&lt; &quot; &quot;;}
</code></pre>
<p>Wenn ich nun eine Vektormatrix</p>
<pre><code>vector&lt; vector&lt;int&gt; &gt; Matrix;
</code></pre>
<p>habe, ist dann eine range based for Schleife ebenfalls möglich?</p>
<p>Wenn ja wie?</p>
<p>Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2495340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2495340</guid><dc:creator><![CDATA[cpp_Jungspund]]></dc:creator><pubDate>Tue, 10 May 2016 09:32:17 GMT</pubDate></item><item><title><![CDATA[Reply to Range based for loop bei Matrizen on Tue, 10 May 2016 09:40:43 GMT]]></title><description><![CDATA[<p>Genau so?</p>
<pre><code>for (const auto &amp;j: Matrix) ...
</code></pre>
<p>Das geht dir so natürlich durch die einzelnen &quot;Zeilen&quot; deiner Liste von Listen. Denn das ist es, was ein vector&lt;vector&gt; darstellt. vector&lt;vector&gt; hat mit dem Konzept einer mathematischen Matrix so ungefähr überhaupt nichts zu tun.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2495341</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2495341</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 10 May 2016 09:40:43 GMT</pubDate></item><item><title><![CDATA[Reply to Range based for loop bei Matrizen on Tue, 10 May 2016 09:53:43 GMT]]></title><description><![CDATA[<p>Danke, das hat mir weitergeholfen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Ich habe das nun so gemacht.</p>
<pre><code>for ( const vector&lt;int&gt; &amp;i : Matrix )
{
   for ( int j : i ) cout &lt;&lt; j &lt;&lt; ' ';
   cout &lt;&lt; endl;
}
</code></pre>
<p>Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2495349</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2495349</guid><dc:creator><![CDATA[cpp_Jungspund]]></dc:creator><pubDate>Tue, 10 May 2016 09:53:43 GMT</pubDate></item></channel></rss>