<?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[normales Array reicht da nicht...]]></title><description><![CDATA[<p>Hi alle zusammen,</p>
<p>ich wollte mal fragen wie mein Problem am besten löse.</p>
<p>Angenommen ich habe einige Fragen zu denen ich mehrere Antworten haben will. Die Anzahl der Antworten ist aber nicht immer gleich. Wenn ich jetzt 5 Fragen habe, die gefragt werden können (von 0 bis 4) und habe jeweils unterschiedliche anzahlen von Antworten. Wie lege ich die Antworten zu den Fragen am besten ab?</p>
<p>Thnx im Vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/180497/normales-array-reicht-da-nicht</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 20:33:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/180497.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 03 May 2007 13:54:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to normales Array reicht da nicht... on Thu, 03 May 2007 13:54:01 GMT]]></title><description><![CDATA[<p>Hi alle zusammen,</p>
<p>ich wollte mal fragen wie mein Problem am besten löse.</p>
<p>Angenommen ich habe einige Fragen zu denen ich mehrere Antworten haben will. Die Anzahl der Antworten ist aber nicht immer gleich. Wenn ich jetzt 5 Fragen habe, die gefragt werden können (von 0 bis 4) und habe jeweils unterschiedliche anzahlen von Antworten. Wie lege ich die Antworten zu den Fragen am besten ab?</p>
<p>Thnx im Vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278134</guid><dc:creator><![CDATA[Incubus_ST]]></dc:creator><pubDate>Thu, 03 May 2007 13:54:01 GMT</pubDate></item><item><title><![CDATA[Reply to normales Array reicht da nicht... on Thu, 03 May 2007 14:01:06 GMT]]></title><description><![CDATA[<p>Keine Ahnung, kommt drauf an, was du können willst, etc.</p>
<p>vector&lt;pair&lt;string, vector&lt;string&gt; &gt; &gt;<br />
map&lt;string, vector&lt;string&gt; &gt;<br />
...<br />
gibt tausende von Möglichkeiten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278136</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278136</guid><dc:creator><![CDATA[Helium]]></dc:creator><pubDate>Thu, 03 May 2007 14:01:06 GMT</pubDate></item><item><title><![CDATA[Reply to normales Array reicht da nicht... on Thu, 03 May 2007 14:24:29 GMT]]></title><description><![CDATA[<p>Danke!</p>
<p>Wie adressiert man denn bei map&lt;string, vector&lt;string&gt; &gt; die einzelnen Strings in dem Vector der Map?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278149</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278149</guid><dc:creator><![CDATA[Incubus_ST]]></dc:creator><pubDate>Thu, 03 May 2007 14:24:29 GMT</pubDate></item><item><title><![CDATA[Reply to normales Array reicht da nicht... on Thu, 03 May 2007 14:42:39 GMT]]></title><description><![CDATA[<p>Incubus_ST schrieb:</p>
<blockquote>
<p>Danke!</p>
<p>Wie adressiert man denn bei map&lt;string, vector&lt;string&gt; &gt; die einzelnen Strings in dem Vector der Map?</p>
</blockquote>
<p>z.B. mit iteratoren</p>
<pre><code class="language-cpp">//eingabe
vector&lt;string&gt; stringvec1;
stringvec1.push_back(&quot;aaa&quot;);
stringvec1.push_back(&quot;bbb&quot;);
stringvec1.push_back(&quot;ccc&quot;);

vector&lt;string&gt; stringvec2;
stringvec2.push_back(&quot;aaa&quot;);
stringvec2.push_back(&quot;bbb&quot;);
stringvec2.push_back(&quot;ccc&quot;);

map&lt;string, vector&lt;string&gt; &gt; stringmap;
stringmap[&quot;a&quot;] = stringvec1; //hier wird eine kopie von stringvec1 
                             //zur map hinzugefügt.
stringvec1.push_back(&quot;ddd&quot;); //diese änderung erfährt der in der map 
                             //gespeicherte vector natürlich nicht

stringmap[&quot;b&quot;] = stringvec2; //hier wird eine kopie von stringvec3 
                             //zur map hinzugefügt.

//ausgabe
for( map&lt;string, vector&lt;string&gt; &gt;::iterator it = stringmap.begin();
     it!=stringmap.end();
     ++it)
{
   vector&lt;string&gt;&amp; vec = it-&gt;second;
   for(int i=0; i&lt;(unsigned)vec.size(); ++i)
   {
      cout&lt;&lt;&quot;i:&quot;&lt;&lt; vec[i] &lt;&lt; endl;
   }
}

//dummy
stringmap[&quot;a&quot;] = stringvec2; //der an der stelle &quot;a&quot; gespeicherte stringvec
                             //wird ersetzt.
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1278156</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278156</guid><dc:creator><![CDATA[muffmolch]]></dc:creator><pubDate>Thu, 03 May 2007 14:42:39 GMT</pubDate></item></channel></rss>