<?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[Switch mit string?]]></title><description><![CDATA[<p>Hallo,<br />
habe mal ne kleine frage, die mich schon länger beschäftigt. Gibt es irgendeine bibliothek oder headerdatei, die eine switchkonstruktion auch mit einem string als ausdruck zulässt?<br />
Also in etwa so:</p>
<pre><code class="language-cpp">switch (string) {

        case &quot;foo&quot;:

                break;

        case &quot;bar&quot;:

                break;

}
</code></pre>
<p>Falls nicht, würde es in einem machbaren rahmen bleiben (also nicht zu lange dauern) so etwas selbst zu programmieren? Ich hab sowas in der art noch nie gemacht, also keine ahnung weiweit das technisch umsetzbar ist...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/198882/switch-mit-string</link><generator>RSS for Node</generator><lastBuildDate>Fri, 02 Oct 2026 16:46:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/198882.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Nov 2007 17:46:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Switch mit string? on Mon, 26 Nov 2007 17:46:01 GMT]]></title><description><![CDATA[<p>Hallo,<br />
habe mal ne kleine frage, die mich schon länger beschäftigt. Gibt es irgendeine bibliothek oder headerdatei, die eine switchkonstruktion auch mit einem string als ausdruck zulässt?<br />
Also in etwa so:</p>
<pre><code class="language-cpp">switch (string) {

        case &quot;foo&quot;:

                break;

        case &quot;bar&quot;:

                break;

}
</code></pre>
<p>Falls nicht, würde es in einem machbaren rahmen bleiben (also nicht zu lange dauern) so etwas selbst zu programmieren? Ich hab sowas in der art noch nie gemacht, also keine ahnung weiweit das technisch umsetzbar ist...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1410509</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1410509</guid><dc:creator><![CDATA[el primato]]></dc:creator><pubDate>Mon, 26 Nov 2007 17:46:01 GMT</pubDate></item><item><title><![CDATA[Reply to Switch mit string? on Mon, 26 Nov 2007 18:00:17 GMT]]></title><description><![CDATA[<p>Nein so geht das nicht. Leider.<br />
Da musst du wohl weiter if benutzen müssen...</p>
<pre><code class="language-cpp">if(0==strcmp(&quot;foo&quot;,String))
{/*Wenn Ja*/}
else if(0==... Und so weiter
Für default einfach else ranhängen
</code></pre>
<p>Außerdem ist switch nicht irgendwo in einer Bibliothek definiert sondern ist schon vorgegeben. -&gt; Da kannst du wohl nichts dran rütteln</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1410514</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1410514</guid><dc:creator><![CDATA[Nena99]]></dc:creator><pubDate>Mon, 26 Nov 2007 18:00:17 GMT</pubDate></item><item><title><![CDATA[Reply to Switch mit string? on Mon, 26 Nov 2007 18:08:52 GMT]]></title><description><![CDATA[<p>Du könntest dafür eine std:map einsetzen, s.a.<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-175346-and-highlight-is-switch+map.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-175346-and-highlight-is-switch+map.html</a></p>
<p>Dort sind auch weitere Links angegeben...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1410519</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1410519</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Mon, 26 Nov 2007 18:08:52 GMT</pubDate></item><item><title><![CDATA[Reply to Switch mit string? on Mon, 26 Nov 2007 19:26:08 GMT]]></title><description><![CDATA[<p>Danke für die antworten. Besonders der letzte tipp war super!<br />
Hat mir weitergeholfen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1410563</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1410563</guid><dc:creator><![CDATA[el primato]]></dc:creator><pubDate>Mon, 26 Nov 2007 19:26:08 GMT</pubDate></item></channel></rss>