<?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[ganzes wort überprüfen]]></title><description><![CDATA[<p>Hi,</p>
<p>ich wollte fragen wie ich ein ganzes wort geschickt überprüfen kann, da man ja nicht folgendes machen kann:</p>
<pre><code class="language-cpp">char input[25];

std::cin &gt;&gt; input;

switch(input)
{
   case &quot;hallo&quot;:
   {
      std::cout &lt;&lt; &quot;Hallo&quot;;
   }
}
</code></pre>
<p>Mfg Yazoo</p>
<p>P.S.: :xmas1: :xmas1: :xmas1: Sorry das ich in letzter Zeit so viel frage. :xmas1: :xmas1: :xmas1:</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/200611/ganzes-wort-überprüfen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Oct 2026 01:10:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/200611.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 17 Dec 2007 14:15:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ganzes wort überprüfen on Mon, 17 Dec 2007 14:16:50 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich wollte fragen wie ich ein ganzes wort geschickt überprüfen kann, da man ja nicht folgendes machen kann:</p>
<pre><code class="language-cpp">char input[25];

std::cin &gt;&gt; input;

switch(input)
{
   case &quot;hallo&quot;:
   {
      std::cout &lt;&lt; &quot;Hallo&quot;;
   }
}
</code></pre>
<p>Mfg Yazoo</p>
<p>P.S.: :xmas1: :xmas1: :xmas1: Sorry das ich in letzter Zeit so viel frage. :xmas1: :xmas1: :xmas1:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1421992</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1421992</guid><dc:creator><![CDATA[Yazoo]]></dc:creator><pubDate>Mon, 17 Dec 2007 14:16:50 GMT</pubDate></item><item><title><![CDATA[Reply to ganzes wort überprüfen on Mon, 17 Dec 2007 14:22:42 GMT]]></title><description><![CDATA[<p>Strings kannst du nicht akls case-Marken verwenden - da mußt du auf die &quot;klassische&quot; if-else-Kaskade ausweichen (oder mit Arrays und find() arbeiten):</p>
<pre><code class="language-cpp">char input[25];

std::cin &gt;&gt; input;

if(strcmp(input,&quot;hallo&quot;)==0)
{
  std::cout &lt;&lt; &quot;Hallo&quot;;
}
else
  ...

//oder besser:

string input;

cin&gt;&gt;input;

if(input==&quot;hallo&quot;)
  cout&lt;&lt;&quot;Ebenfalls Hallo!&quot;;
else
  ...
</code></pre>
<pre><code class="language-cpp">//und als besonderes Schmankerl noch die Lösung mit Arrays:
string valid_inputs[]={&quot;hallo&quot;,&quot;guten tag&quot;,...};
int valid_count = sizeof(valid_inputs)/sizeof(string);

string input;
cin&gt;&gt;input;
switch(find(valid_inputs,valid_inputs+valid_count,input)-valid_inputs)
{
case 0://&quot;hallo&quot;
  cout&lt;&lt;&quot;Hallo&quot;;break;
case 1://&quot;guten tag&quot;
  cout&lt;&lt;&quot;Ganz wie du wünschst&quot;;break;
...
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1421998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1421998</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 17 Dec 2007 14:22:42 GMT</pubDate></item><item><title><![CDATA[Reply to ganzes wort überprüfen on Mon, 17 Dec 2007 14:33:53 GMT]]></title><description><![CDATA[<p>danke das hat mir schonmal sehr geholfen</p>
<p>vielleicht noch eine kleine frage:<br />
was müsste ich machen, wenn ich 2 Wörter auf einmal einlesen möchte?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1422009</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1422009</guid><dc:creator><![CDATA[Yazoo]]></dc:creator><pubDate>Mon, 17 Dec 2007 14:33:53 GMT</pubDate></item><item><title><![CDATA[Reply to ganzes wort überprüfen on Mon, 17 Dec 2007 14:37:32 GMT]]></title><description><![CDATA[<p>getline() verwenden (oder dem Nutzer erklären, daß er seine Wörter mit _ anstelle von Leerzeichen trennen soll :D).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1422016</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1422016</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 17 Dec 2007 14:37:32 GMT</pubDate></item><item><title><![CDATA[Reply to ganzes wort überprüfen on Mon, 17 Dec 2007 14:38:40 GMT]]></title><description><![CDATA[<p>thx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1422017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1422017</guid><dc:creator><![CDATA[Yazoo]]></dc:creator><pubDate>Mon, 17 Dec 2007 14:38:40 GMT</pubDate></item><item><title><![CDATA[Reply to ganzes wort überprüfen on Mon, 17 Dec 2007 16:32:24 GMT]]></title><description><![CDATA[<p>CStoll schrieb:</p>
<blockquote>
<p>Strings kannst du nicht akls case-Marken verwenden - da mußt du auf die &quot;klassische&quot; if-else-Kaskade ausweichen (oder mit Arrays und find() arbeiten):</p>
</blockquote>
<p>.NET generiert Hastabellen für String-switch-Blöcke. Hashtabellen sind hier sicher von der durchschnittlichen Performance am geeignetsten. Leider unterstützt bisher kaum ein Compiler eine standardisierte Hashtabelle, aber immerhin kennt der aktuelle GCC schon 'std::tr1::unordered_map' und unter VC++ kann man ja bis Frühjahr 2008 noch auf 'stdext::hash_map' ausweichen.</p>
<p>– Alle anderen Methoden benötigen auch im Durchschnitt eine logarithmische Laufzeit, während Hashtabellen oft konstante Laufzeit ermöglichen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1422132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1422132</guid><dc:creator><![CDATA[Konrad Rudolph]]></dc:creator><pubDate>Mon, 17 Dec 2007 16:32:24 GMT</pubDate></item></channel></rss>