<?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[dynamischer instanzname]]></title><description><![CDATA[<p>Hallo miteinander</p>
<p>Ich habe da ein Problem, und zwar möchte ich Instanzen von Klassen mit dynamischen Namen erstellen.</p>
<p>Also ungefähr so stell ich mir das vor:</p>
<pre><code>string Instanzname=&quot;Murli&quot;;

katze Instanzname;//hier sollte jetzt die katze Murli instanziert werden
Instanzname.makeVoice(&quot;Miau&quot;);
</code></pre>
<p>so funktioniert es jedenfalls nicht</p>
<p>kann mir da irgendjemand helfen?<br />
mfg kobauder</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/158994/dynamischer-instanzname</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 07:47:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/158994.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Sep 2006 08:29:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to dynamischer instanzname on Mon, 11 Sep 2006 08:29:09 GMT]]></title><description><![CDATA[<p>Hallo miteinander</p>
<p>Ich habe da ein Problem, und zwar möchte ich Instanzen von Klassen mit dynamischen Namen erstellen.</p>
<p>Also ungefähr so stell ich mir das vor:</p>
<pre><code>string Instanzname=&quot;Murli&quot;;

katze Instanzname;//hier sollte jetzt die katze Murli instanziert werden
Instanzname.makeVoice(&quot;Miau&quot;);
</code></pre>
<p>so funktioniert es jedenfalls nicht</p>
<p>kann mir da irgendjemand helfen?<br />
mfg kobauder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134960</guid><dc:creator><![CDATA[kobauder]]></dc:creator><pubDate>Mon, 11 Sep 2006 08:29:09 GMT</pubDate></item><item><title><![CDATA[Reply to dynamischer instanzname on Mon, 11 Sep 2006 08:37:44 GMT]]></title><description><![CDATA[<p>Das geht mit C++ so nicht, aber man kann da sich mit einer Map aushelfen:</p>
<pre><code class="language-cpp">std::map&lt;std::string, katze&gt; dynCats;
std::string instanzname = &quot;Murli&quot;;
dynCats[instanzname] = katze();
dynCats[instanzname].makeVoice(&quot;miau&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1134968</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134968</guid><dc:creator><![CDATA[Vellas]]></dc:creator><pubDate>Mon, 11 Sep 2006 08:37:44 GMT</pubDate></item><item><title><![CDATA[Reply to dynamischer instanzname on Mon, 11 Sep 2006 08:52:38 GMT]]></title><description><![CDATA[<p>ich werds dann halt so probieren<br />
Danke für die hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134983</guid><dc:creator><![CDATA[kobauder]]></dc:creator><pubDate>Mon, 11 Sep 2006 08:52:38 GMT</pubDate></item></channel></rss>