<?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[Problem: map und iterator]]></title><description><![CDATA[<pre><code>void		xtWorld::Render(string animname , SDL_Rect* r)
{
	map&lt;string , xtObject&gt;::iterator	it;

	for (it = mapObjects.begin(); it != mapObjects.end(); it++)
	{
		(*it).StartAnim(animname , r);
	}
}
</code></pre>
<p>mapObjects ist vom Typ map&lt;string , xtObject&gt;.<br />
Irgendwie will das mein compiler (g++) nicht kompilieren.</p>
<pre><code>[...] error: 'StartAnim' undeclared (first use this function)
</code></pre>
<p>Darf man überhaupt iteratoren im zusammenhang mit maps benutzen?</p>
<p>Ich will mittels iterator die map durchlaufen und dabei jedes Element rendern(StartAnim aufrufen).<br />
ps: Ja, ich habe mit Absicht eine map genommen und keinen vector.</p>
<p>Und it-&gt;StartAnim(animname , r); ging auch nicht.</p>
<p>Hat jemand eine Ahnung?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/134224/problem-map-und-iterator</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 11:37:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/134224.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Jan 2006 16:48:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem: map und iterator on Tue, 24 Jan 2006 16:49:21 GMT]]></title><description><![CDATA[<pre><code>void		xtWorld::Render(string animname , SDL_Rect* r)
{
	map&lt;string , xtObject&gt;::iterator	it;

	for (it = mapObjects.begin(); it != mapObjects.end(); it++)
	{
		(*it).StartAnim(animname , r);
	}
}
</code></pre>
<p>mapObjects ist vom Typ map&lt;string , xtObject&gt;.<br />
Irgendwie will das mein compiler (g++) nicht kompilieren.</p>
<pre><code>[...] error: 'StartAnim' undeclared (first use this function)
</code></pre>
<p>Darf man überhaupt iteratoren im zusammenhang mit maps benutzen?</p>
<p>Ich will mittels iterator die map durchlaufen und dabei jedes Element rendern(StartAnim aufrufen).<br />
ps: Ja, ich habe mit Absicht eine map genommen und keinen vector.</p>
<p>Und it-&gt;StartAnim(animname , r); ging auch nicht.</p>
<p>Hat jemand eine Ahnung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/975146</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/975146</guid><dc:creator><![CDATA[alex89ru]]></dc:creator><pubDate>Tue, 24 Jan 2006 16:49:21 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: map und iterator on Tue, 24 Jan 2006 16:54:55 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">it-&gt;second.startAnim (animname, r);
</code></pre>
<p>Die Iteratoren zeigen auf die Key-Value-Paare (hier std::pair&lt;std::string, xtObject&gt;).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/975154</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/975154</guid><dc:creator><![CDATA[.filmor]]></dc:creator><pubDate>Tue, 24 Jan 2006 16:54:55 GMT</pubDate></item><item><title><![CDATA[Reply to Problem: map und iterator on Tue, 24 Jan 2006 17:03:57 GMT]]></title><description><![CDATA[<p>EDIT_3:Ok, thx...jetzt lässt es sich kompilieren.<br />
EDIT_4:Und es funktioniert perfekt!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/975155</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/975155</guid><dc:creator><![CDATA[alex89ru]]></dc:creator><pubDate>Tue, 24 Jan 2006 17:03:57 GMT</pubDate></item></channel></rss>