<?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[Frage zu vector]]></title><description><![CDATA[<p>Hallo, was macht dieser Befehl genau ?</p>
<pre><code class="language-cpp">vector&lt; vector&lt;int&gt; &gt; var;
</code></pre>
<p>Was is ein normaler Vector ist das weiss ich, aber ein vector im vector was passiert da? o_O</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/298947/frage-zu-vector</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 15:12:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/298947.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 Jan 2012 18:33:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zu vector on Mon, 30 Jan 2012 18:33:55 GMT]]></title><description><![CDATA[<p>Hallo, was macht dieser Befehl genau ?</p>
<pre><code class="language-cpp">vector&lt; vector&lt;int&gt; &gt; var;
</code></pre>
<p>Was is ein normaler Vector ist das weiss ich, aber ein vector im vector was passiert da? o_O</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2174736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2174736</guid><dc:creator><![CDATA[vecvec]]></dc:creator><pubDate>Mon, 30 Jan 2012 18:33:55 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu vector on Mon, 30 Jan 2012 18:35:20 GMT]]></title><description><![CDATA[<p>Das macht einen vector aus vectoren. Manche Leute machen sowas wenn sie ein 2D Array haben wollen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2174737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2174737</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Mon, 30 Jan 2012 18:35:20 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu vector on Mon, 30 Jan 2012 18:40:46 GMT]]></title><description><![CDATA[<p>Kann man den nur so ein 2D Vector machen?</p>
<p>Wenn man keinen Vector verwendet dann kann man ja auch schreiben z.b.</p>
<p>int var[2][2];</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2174741</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2174741</guid><dc:creator><![CDATA[vecvec]]></dc:creator><pubDate>Mon, 30 Jan 2012 18:40:46 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu vector on Mon, 30 Jan 2012 18:42:20 GMT]]></title><description><![CDATA[<p>Das ist dann aber kein vector sondern ein Array fixer Größe...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2174745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2174745</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Mon, 30 Jan 2012 18:42:20 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu vector on Mon, 30 Jan 2012 18:52:01 GMT]]></title><description><![CDATA[<p>dot schrieb:</p>
<blockquote>
<p>Das ist dann aber kein vector sondern ein Array fixer Größe...</p>
</blockquote>
<p>Und das auch noch im C-Style. Wenn es nicht um Performance geht (und selbst das schien in einem Thread hier widerlegt worden zu sein, korrigiert mich bitte), soll man das lassen (auch wenn man, wenn man lernt damit umzugehen, ganz gute Chancen hat, es nicht zu verbocken).</p>
<p>Ein vector von vector's ist einfach ein normaler Vektor, bei dem jedes Element ein anderer Vektor ist. Also zuerst mit at() oder operator[]() einen vector herauswählen, un dann bearbeiten.</p>
<pre><code class="language-cpp">std::vector&lt;std::vector&lt;int&gt;&gt; vec;

vec.push_back({1,2,3,4}); //Einen vector in vec einfügen.
vec.at(0).at(0); // 1
</code></pre>
<p>Ich nehme mal an, der Konstruktor mit der <code>initializer_list</code> ist nicht <code>explicit</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2174757</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2174757</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 30 Jan 2012 18:52:01 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu vector on Mon, 30 Jan 2012 19:00:13 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<p>dot schrieb:</p>
<blockquote>
<p>Das ist dann aber kein vector sondern ein Array fixer Größe...</p>
</blockquote>
<p>Und das auch noch im C-Style.</p>
</blockquote>
<p>Wie sieht denn der entsprechende C++ Style aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2174769</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2174769</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 30 Jan 2012 19:00:13 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu vector on Mon, 30 Jan 2012 19:02:38 GMT]]></title><description><![CDATA[<p>Gugelmoser schrieb:</p>
<blockquote>
<p>Hacker schrieb:</p>
<blockquote>
<p>dot schrieb:</p>
<blockquote>
<p>Das ist dann aber kein vector sondern ein Array fixer Größe...</p>
</blockquote>
<p>Und das auch noch im C-Style.</p>
</blockquote>
<p>Wie sieht denn der entsprechende C++ Style aus?</p>
</blockquote>
<p>Ja gleich natürlich. Ein vector aus vectoren ist imo jetzt nicht unbedingt die ideale Lösung für mehrdimensionale Arrays. Besser sowas wie boost::multi_array.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2174773</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2174773</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Mon, 30 Jan 2012 19:02:38 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu vector on Mon, 30 Jan 2012 19:03:22 GMT]]></title><description><![CDATA[<p>Gugelmoser schrieb:</p>
<blockquote>
<p>Hacker schrieb:</p>
<blockquote>
<p>dot schrieb:</p>
<blockquote>
<p>Das ist dann aber kein vector sondern ein Array fixer Größe...</p>
</blockquote>
<p>Und das auch noch im C-Style.</p>
</blockquote>
<p>Wie sieht denn der entsprechende C++ Style aus?</p>
</blockquote>
<pre><code class="language-cpp">std::array&lt;std::array&lt;int, 2&gt;, 2&gt; var;  //evtl. auch std::tr1::array oder boost::array
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2174774</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2174774</guid><dc:creator><![CDATA[wxSkip]]></dc:creator><pubDate>Mon, 30 Jan 2012 19:03:22 GMT</pubDate></item></channel></rss>