<?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!!!]]></title><description><![CDATA[<p>Hallo leute ich hab da ein völig unkompliziertes programm geschrieben:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;conio.h&gt;
#include &lt;string&gt;

using namespace std;

void main(void)
{
  string Name;
  string Antwort;
  bool RA;
  cout &lt;&lt; &quot;Ciao!&quot; &lt;&lt; endl;
  cout &lt;&lt; &quot;Wie heissisch du? &quot;;
  cin  &gt;&gt; Name;
  cout &lt;&lt; Name &lt;&lt; &quot;, gaht's dir guet? &quot;;
  do
  {
  cin  &gt;&gt; Antwort;
  RA = true;
  if (Antwort[0] == 'j')
    cout &lt;&lt; &quot;Schad!&quot; &lt;&lt; endl;
  else if (Antwort[0] == 'J')
    cout &lt;&lt; &quot;Schad!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;nei&quot;)
    cout &lt;&lt; &quot;Schön, aber verzell mir ja nöd dini scheiss Problem!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Nei&quot;)
    cout &lt;&lt; &quot;Schön, aber verzell mir ja nöd dini scheiss Problem!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;es&quot;)
    cout &lt;&lt; &quot;Das isch Pech, interresiert mich aber nöd würklich!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Es&quot;)
    cout &lt;&lt; &quot;Das isch Pech, interresiert mich aber nöd würklich!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;cha&quot;)
    cout &lt;&lt; &quot;Schad da muen ich wohl chli nahelfe!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Cha&quot;)
    cout &lt;&lt; &quot;Schad da muen ich wohl chli nahelfe!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;chönnt&quot;)
    cout &lt;&lt; &quot;Freut mich&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Chönnt&quot;)
    cout &lt;&lt; &quot;Freut mich&quot; &lt;&lt; endl;
  else
    {
    RA = false;
    cerr &lt;&lt; &quot;Sorry ha dich nöd verstande, schrieb nomal, aber gfälligst &quot;
         &lt;&lt; &quot;so das ich's verstah!&quot; &lt;&lt; endl;
    }
  } while (!RA);
  cout &lt;&lt; &quot;Also Tschüss!&quot; &lt;&lt; endl;
  getch ();
}
</code></pre>
<p>Das Problem ist nun wen ich eine falsche antwort mit mehreren worten eingebe kommt der cerr-Teil fast am schluss so viel mal wie ich worte geschrieben habe!<br />
Wie kann ich das ändern?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/132425/problem</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 15:06:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/132425.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Jan 2006 20:04:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem!!! on Tue, 10 Jan 2006 20:04:35 GMT]]></title><description><![CDATA[<p>Hallo leute ich hab da ein völig unkompliziertes programm geschrieben:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;conio.h&gt;
#include &lt;string&gt;

using namespace std;

void main(void)
{
  string Name;
  string Antwort;
  bool RA;
  cout &lt;&lt; &quot;Ciao!&quot; &lt;&lt; endl;
  cout &lt;&lt; &quot;Wie heissisch du? &quot;;
  cin  &gt;&gt; Name;
  cout &lt;&lt; Name &lt;&lt; &quot;, gaht's dir guet? &quot;;
  do
  {
  cin  &gt;&gt; Antwort;
  RA = true;
  if (Antwort[0] == 'j')
    cout &lt;&lt; &quot;Schad!&quot; &lt;&lt; endl;
  else if (Antwort[0] == 'J')
    cout &lt;&lt; &quot;Schad!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;nei&quot;)
    cout &lt;&lt; &quot;Schön, aber verzell mir ja nöd dini scheiss Problem!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Nei&quot;)
    cout &lt;&lt; &quot;Schön, aber verzell mir ja nöd dini scheiss Problem!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;es&quot;)
    cout &lt;&lt; &quot;Das isch Pech, interresiert mich aber nöd würklich!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Es&quot;)
    cout &lt;&lt; &quot;Das isch Pech, interresiert mich aber nöd würklich!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;cha&quot;)
    cout &lt;&lt; &quot;Schad da muen ich wohl chli nahelfe!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Cha&quot;)
    cout &lt;&lt; &quot;Schad da muen ich wohl chli nahelfe!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;chönnt&quot;)
    cout &lt;&lt; &quot;Freut mich&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Chönnt&quot;)
    cout &lt;&lt; &quot;Freut mich&quot; &lt;&lt; endl;
  else
    {
    RA = false;
    cerr &lt;&lt; &quot;Sorry ha dich nöd verstande, schrieb nomal, aber gfälligst &quot;
         &lt;&lt; &quot;so das ich's verstah!&quot; &lt;&lt; endl;
    }
  } while (!RA);
  cout &lt;&lt; &quot;Also Tschüss!&quot; &lt;&lt; endl;
  getch ();
}
</code></pre>
<p>Das Problem ist nun wen ich eine falsche antwort mit mehreren worten eingebe kommt der cerr-Teil fast am schluss so viel mal wie ich worte geschrieben habe!<br />
Wie kann ich das ändern?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/963052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/963052</guid><dc:creator><![CDATA[Aramus Aran]]></dc:creator><pubDate>Tue, 10 Jan 2006 20:04:35 GMT</pubDate></item><item><title><![CDATA[Reply to Problem!!! on Wed, 11 Jan 2006 00:04:53 GMT]]></title><description><![CDATA[<p>Hallo,<br />
1. Aussagekräftige Titel helfen den anderen dein Problem direkt besser einzuschätzen<br />
2. main() hat als Rückgabetyp int und nicht void und zu guter letzt<br />
3. Probier mal die Eingabe mit getline zu machen, dann liest er in einem Rutsch die gesamte Zeile aus:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;conio.h&gt;
#include &lt;string&gt;

using namespace std;

int main(void)
{
  string Name;
  string Antwort;
  bool RA;
  cout &lt;&lt; &quot;Ciao!&quot; &lt;&lt; endl;
  cout &lt;&lt; &quot;Wie heissisch du? &quot;;
  getline(cin,Name);
  cout &lt;&lt; Name &lt;&lt; &quot;, gaht's dir guet? &quot; &lt;&lt; endl;
  do
  {
  getline(cin, Antwort);
  RA = true;
  if (Antwort[0] == 'j')
    cout &lt;&lt; &quot;Schad!&quot; &lt;&lt; endl;
  else if (Antwort[0] == 'J')
    cout &lt;&lt; &quot;Schad!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;nei&quot;)
    cout &lt;&lt; &quot;Schön, aber verzell mir ja nöd dini scheiss Problem!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Nei&quot;)
    cout &lt;&lt; &quot;Schön, aber verzell mir ja nöd dini scheiss Problem!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;es&quot;)
    cout &lt;&lt; &quot;Das isch Pech, interresiert mich aber nöd würklich!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Es&quot;)
    cout &lt;&lt; &quot;Das isch Pech, interresiert mich aber nöd würklich!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;cha&quot;)
    cout &lt;&lt; &quot;Schad da muen ich wohl chli nahelfe!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Cha&quot;)
    cout &lt;&lt; &quot;Schad da muen ich wohl chli nahelfe!&quot; &lt;&lt; endl;
  else if (Antwort == &quot;chönnt&quot;)
    cout &lt;&lt; &quot;Freut mich&quot; &lt;&lt; endl;
  else if (Antwort == &quot;Chönnt&quot;)
    cout &lt;&lt; &quot;Freut mich&quot; &lt;&lt; endl;
  else
    {
    RA = false;
    cerr &lt;&lt; &quot;Sorry ha dich nöd verstande, schrieb nomal, aber gfälligst &quot;
         &lt;&lt; &quot;so das ich's verstah!&quot; &lt;&lt; endl;
    }
  } while (!RA);
  cout &lt;&lt; &quot;Also Tschüss!&quot; &lt;&lt; endl;
  getch ();
}
</code></pre>
<p>MfG Jaschi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/963204</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/963204</guid><dc:creator><![CDATA[Jaschi]]></dc:creator><pubDate>Wed, 11 Jan 2006 00:04:53 GMT</pubDate></item><item><title><![CDATA[Reply to Problem!!! on Wed, 11 Jan 2006 12:34:36 GMT]]></title><description><![CDATA[<p>Ja danke hat geklappt, das mit dem namen mach ich nächstes mal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/963490</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/963490</guid><dc:creator><![CDATA[Aramus Aran]]></dc:creator><pubDate>Wed, 11 Jan 2006 12:34:36 GMT</pubDate></item><item><title><![CDATA[Reply to Problem!!! on Wed, 11 Jan 2006 12:43:29 GMT]]></title><description><![CDATA[<p>Noch ein Tipp:</p>
<pre><code class="language-cpp">cerr &lt;&lt; &quot;Sorry ha dich nöd verstande, schrieb nomal, aber gfälligst &quot;
         &lt;&lt; &quot;so das ich's verstah!&quot; &lt;&lt; endl;
</code></pre>
<p>Der Präprozessor sorgt schon selbst dafür, dass String Literale zusammengefügt werden.</p>
<pre><code class="language-cpp">cerr &lt;&lt; &quot;Sorry ha dich nöd verstande, schrieb nomal, aber gfälligst &quot;
            &quot;so das ich's verstah!&quot; &lt;&lt; endl;
</code></pre>
<p>Das reicht also vollkommen aus und spart uns einen extra op&lt;&lt; Aufruf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/963501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/963501</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Wed, 11 Jan 2006 12:43:29 GMT</pubDate></item></channel></rss>