<?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[2 dimensionaler dynamischer Vektor]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich muss hier einen 2 dimensionalen dynamischen Vektor erzeugen.</p>
<pre><code class="language-cpp">vector&lt;vector&lt;CString&gt; &gt; Test;
</code></pre>
<p>So, das ist ja auch soweit alles gar kein Problem.</p>
<p>ABER:</p>
<p>Die Größe der 1. dimension und die Größe der 2. dimension ist dynamisch.</p>
<p>Normalerweise würde ich ja jetzt sowas machen um den Vektor mit Daten zu füllen:</p>
<pre><code class="language-cpp">vector&lt;CString&gt; blupp;
blupp.pushback(&quot;hallo1&quot;);
blupp.pushback(&quot;hallo2&quot;);
blupp.pushback(&quot;hallo3&quot;);
blupp.pushback(&quot;hallo4&quot;);

test.pushback(blupp);
</code></pre>
<p>So, dann hätte ich ja folgendes Ergebnis:</p>
<pre><code>test[0][0] = hallo1;
test[0][1] = hallo2;
test[0][2] = hallo3;
test[0][3] = hallo4;
</code></pre>
<p>Was aber mache ich, wenn ich dort jetzt noch auf der 2. dimension 0. Element der ersten dimension Daten hinzufügen möchte?</p>
<p>Wenn ich das wie oben mache, dann packt der mir natürlich in der 1. dimension ein weiteres Element darein!?!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/204808/2-dimensionaler-dynamischer-vektor</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 18:03:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/204808.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Feb 2008 08:35:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 2 dimensionaler dynamischer Vektor on Thu, 07 Feb 2008 08:35:16 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich muss hier einen 2 dimensionalen dynamischen Vektor erzeugen.</p>
<pre><code class="language-cpp">vector&lt;vector&lt;CString&gt; &gt; Test;
</code></pre>
<p>So, das ist ja auch soweit alles gar kein Problem.</p>
<p>ABER:</p>
<p>Die Größe der 1. dimension und die Größe der 2. dimension ist dynamisch.</p>
<p>Normalerweise würde ich ja jetzt sowas machen um den Vektor mit Daten zu füllen:</p>
<pre><code class="language-cpp">vector&lt;CString&gt; blupp;
blupp.pushback(&quot;hallo1&quot;);
blupp.pushback(&quot;hallo2&quot;);
blupp.pushback(&quot;hallo3&quot;);
blupp.pushback(&quot;hallo4&quot;);

test.pushback(blupp);
</code></pre>
<p>So, dann hätte ich ja folgendes Ergebnis:</p>
<pre><code>test[0][0] = hallo1;
test[0][1] = hallo2;
test[0][2] = hallo3;
test[0][3] = hallo4;
</code></pre>
<p>Was aber mache ich, wenn ich dort jetzt noch auf der 2. dimension 0. Element der ersten dimension Daten hinzufügen möchte?</p>
<p>Wenn ich das wie oben mache, dann packt der mir natürlich in der 1. dimension ein weiteres Element darein!?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1451020</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1451020</guid><dc:creator><![CDATA[MSS-Software]]></dc:creator><pubDate>Thu, 07 Feb 2008 08:35:16 GMT</pubDate></item><item><title><![CDATA[Reply to 2 dimensionaler dynamischer Vektor on Thu, 07 Feb 2008 08:40:13 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">test[0].push_back(...);
</code></pre>
<p>Meinst du das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1451022</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1451022</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Thu, 07 Feb 2008 08:40:13 GMT</pubDate></item><item><title><![CDATA[Reply to 2 dimensionaler dynamischer Vektor on Thu, 07 Feb 2008 08:41:46 GMT]]></title><description><![CDATA[<p>ja, das hört sich toll an</p>
<p>probier ich gleich aus</p>
<p>thx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1451023</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1451023</guid><dc:creator><![CDATA[MSS-Software]]></dc:creator><pubDate>Thu, 07 Feb 2008 08:41:46 GMT</pubDate></item></channel></rss>