<?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[STL_ Random Access Iterator]]></title><description><![CDATA[<p>Hallole.<br />
Ich steh gerade voll auf dem Schlauch.<br />
Ich möchte mithilfe einer multimap über einem wahlfreien Zugriff diverse Daten auslesen.<br />
Ein Iterator ist ja kein Problem,aber wie schaffe ich es,daß ich wahlfrei drauf zugreifen kann?<br />
Egal was ich versuche,immer motzt der Compiler mich an, wegen Fehler.<br />
Es steht zwar tausendfach beschrieben was ein Random Iterator ist,aber wie man in deklariert und nachher auf die multimal zugreifen kann steht nirgens.</p>
<pre><code>multimap&lt;string, string&gt;::iterator it_k;

for(it_k=pers_map.begin();it_k!=pers_map.end();it_k++)
{
....

*(it_k)+10;//geht halt net

}
</code></pre>
<p>Da kommt Fehler.</p>
<p>Also die Frage ist, wie mache ich einen random Iterator und wie kann ich dann den wahlfreien Zugriff auf die Multimal realisieren?</p>
<p>danke Mondmann</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/178318/stl_-random-access-iterator</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 19:27:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/178318.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Apr 2007 11:17:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to STL_ Random Access Iterator on Tue, 10 Apr 2007 11:17:19 GMT]]></title><description><![CDATA[<p>Hallole.<br />
Ich steh gerade voll auf dem Schlauch.<br />
Ich möchte mithilfe einer multimap über einem wahlfreien Zugriff diverse Daten auslesen.<br />
Ein Iterator ist ja kein Problem,aber wie schaffe ich es,daß ich wahlfrei drauf zugreifen kann?<br />
Egal was ich versuche,immer motzt der Compiler mich an, wegen Fehler.<br />
Es steht zwar tausendfach beschrieben was ein Random Iterator ist,aber wie man in deklariert und nachher auf die multimal zugreifen kann steht nirgens.</p>
<pre><code>multimap&lt;string, string&gt;::iterator it_k;

for(it_k=pers_map.begin();it_k!=pers_map.end();it_k++)
{
....

*(it_k)+10;//geht halt net

}
</code></pre>
<p>Da kommt Fehler.</p>
<p>Also die Frage ist, wie mache ich einen random Iterator und wie kann ich dann den wahlfreien Zugriff auf die Multimal realisieren?</p>
<p>danke Mondmann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1262862</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1262862</guid><dc:creator><![CDATA[Mondmann]]></dc:creator><pubDate>Tue, 10 Apr 2007 11:17:19 GMT</pubDate></item><item><title><![CDATA[Reply to STL_ Random Access Iterator on Tue, 10 Apr 2007 11:38:55 GMT]]></title><description><![CDATA[<p>Mondmann schrieb:</p>
<blockquote>
<p>Egal was ich versuche,immer motzt der Compiler mich an, wegen Fehler.</p>
</blockquote>
<p>Naja, Compiler die einfach so motzen, sind mir auch noch nicht untergekommen. Von daher ist das schonmal kein schlechtes Zeichen.</p>
<blockquote>
<pre><code>*(it_k)+10;//geht halt net
</code></pre>
</blockquote>
<p>Machst halt was falsch.</p>
<p>Ein iterator auf einer (multi)map gibt Dir immer pair zurück, also sind it_k-&gt;first und it_k-&gt;second Schlüssel und Wert in der Map. Zumindest den Wert solltest Du dabei auch verändern können.</p>
<p>BTW:<br />
Falsches Forum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1262890</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1262890</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Tue, 10 Apr 2007 11:38:55 GMT</pubDate></item><item><title><![CDATA[Reply to STL_ Random Access Iterator on Tue, 10 Apr 2007 11:46:15 GMT]]></title><description><![CDATA[<p>Aber wie kann ich denn das machen wenn ich aus einer Multimap jeden 20 Wert auslesen will?<br />
Meine Map besteht aus map &lt;string,string&gt; it_k;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1262901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1262901</guid><dc:creator><![CDATA[Mondmann]]></dc:creator><pubDate>Tue, 10 Apr 2007 11:46:15 GMT</pubDate></item><item><title><![CDATA[Reply to STL_ Random Access Iterator on Tue, 10 Apr 2007 11:53:11 GMT]]></title><description><![CDATA[<p>Map hat afaik nur bidirektionalen Iterator, jedes 20. Element musst du also so ausgeben:</p>
<pre><code class="language-cpp">MapIter iter = map.begin();
for(int i = 0; iter != map.end(); ++i, ++iter)
    if(i%20 == 0)
        cout &lt;&lt; iter-&gt;first &lt;&lt; &quot; / &quot; &lt;&lt; iter-&gt;second &lt;&lt; endl;
</code></pre>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1262905</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1262905</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Tue, 10 Apr 2007 11:53:11 GMT</pubDate></item><item><title><![CDATA[Reply to STL_ Random Access Iterator on Tue, 10 Apr 2007 11:57:25 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-18363.html" rel="nofollow">Jochen Kalmbach</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-58.html" rel="nofollow">C++/CLI mit .NET</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1262909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1262909</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Tue, 10 Apr 2007 11:57:25 GMT</pubDate></item></channel></rss>