<?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[Fehler beim vermeiden von automatischem schliessen]]></title><description><![CDATA[<p>Hallo zusammen<br />
ich habe neulich ein c++ Tutorial gefunden (<a href="http://tutorial.schornboeck.net/inhalt.htm" rel="nofollow">http://tutorial.schornboeck.net/inhalt.htm</a>)<br />
dort wird ein programm beschrieben, welches zwei Zahlen tauschen soll:</p>
<p>#include&lt;iostream&gt;<br />
using namespace std;</p>
<p>int main()<br />
{<br />
int zahl1;<br />
int zahl2;</p>
<p>cout&lt;&lt;&quot;Bitte eine Zahl eingeben\n&quot;;<br />
cin&gt;&gt;zahl1;<br />
cout&lt;&lt;&quot;Bitte noch eine Zahl eingeben\n&quot;;<br />
cin&gt;&gt;zahl2;<br />
cout&lt;&lt;&quot;Zahl 2: &quot;&lt;&lt;zahl2&lt;&lt;&quot;\n&quot;;<br />
cout&lt;&lt;&quot;Zahl 1: &quot;&lt;&lt;zahl1&lt;&lt;&quot;\n&quot;;<br />
}</p>
<p>ich habe auch noch</p>
<p>cin.clear();<br />
cin.ignore(cin.rdbuf()-&gt;in_avail());<br />
cin.get();</p>
<p>hinzugefügt, (wie es im tutorial einmal steht) aber dass Programm schliesst sich dennoch automatisch nach der Zahleneingabe. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /><br />
könnt ihr mir vieleicht sagen warum ?<br />
( ich habe auch schon den ersteller des tutorials deswegen kontaktiert, aber keine Antwort bekommen</p>
<p>freundliche grüsse Michi 13</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/182050/fehler-beim-vermeiden-von-automatischem-schliessen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 11:59:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/182050.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 May 2007 19:05:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler beim vermeiden von automatischem schliessen on Sun, 20 May 2007 19:05:00 GMT]]></title><description><![CDATA[<p>Hallo zusammen<br />
ich habe neulich ein c++ Tutorial gefunden (<a href="http://tutorial.schornboeck.net/inhalt.htm" rel="nofollow">http://tutorial.schornboeck.net/inhalt.htm</a>)<br />
dort wird ein programm beschrieben, welches zwei Zahlen tauschen soll:</p>
<p>#include&lt;iostream&gt;<br />
using namespace std;</p>
<p>int main()<br />
{<br />
int zahl1;<br />
int zahl2;</p>
<p>cout&lt;&lt;&quot;Bitte eine Zahl eingeben\n&quot;;<br />
cin&gt;&gt;zahl1;<br />
cout&lt;&lt;&quot;Bitte noch eine Zahl eingeben\n&quot;;<br />
cin&gt;&gt;zahl2;<br />
cout&lt;&lt;&quot;Zahl 2: &quot;&lt;&lt;zahl2&lt;&lt;&quot;\n&quot;;<br />
cout&lt;&lt;&quot;Zahl 1: &quot;&lt;&lt;zahl1&lt;&lt;&quot;\n&quot;;<br />
}</p>
<p>ich habe auch noch</p>
<p>cin.clear();<br />
cin.ignore(cin.rdbuf()-&gt;in_avail());<br />
cin.get();</p>
<p>hinzugefügt, (wie es im tutorial einmal steht) aber dass Programm schliesst sich dennoch automatisch nach der Zahleneingabe. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /><br />
könnt ihr mir vieleicht sagen warum ?<br />
( ich habe auch schon den ersteller des tutorials deswegen kontaktiert, aber keine Antwort bekommen</p>
<p>freundliche grüsse Michi 13</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288670</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288670</guid><dc:creator><![CDATA[Michi 13]]></dc:creator><pubDate>Sun, 20 May 2007 19:05:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler beim vermeiden von automatischem schliessen on Sun, 20 May 2007 19:10:00 GMT]]></title><description><![CDATA[<p>Lern doch einfach mit der Konsole umzugehen, dann ist's kein Problem mehr.</p>
<p>Auf jeden Fall solltest du den Code so liefern, wie du ihn kompiliert hast und das Ganze in [cpp]-Tags packen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288673</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288673</guid><dc:creator><![CDATA[.filmor]]></dc:creator><pubDate>Sun, 20 May 2007 19:10:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler beim vermeiden von automatischem schliessen on Sun, 20 May 2007 20:19:08 GMT]]></title><description><![CDATA[<p>Wie meinst du mit der Konsole umzugehen ?<br />
Ich hab es so Kompiliert:</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
    using namespace std;

    int main()
    {
      int zahl1;
      int zahl2;

      cout&lt;&lt;&quot;Bitte eine Zahl eingeben\n&quot;;
      cin&gt;&gt;zahl1;
      cout&lt;&lt;&quot;Bitte noch eine Zahl eingeben\n&quot;;
      cin&gt;&gt;zahl2;
      cout&lt;&lt;&quot;Zahl 2: &quot;&lt;&lt;zahl2&lt;&lt;&quot;\n&quot;;
      cout&lt;&lt;&quot;Zahl 1: &quot;&lt;&lt;zahl1&lt;&lt;&quot;\n&quot;;
      cin.clear(); 
      cin.ignore(cin.rdbuf()-&gt;in_avail());
      cin.get();
    }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1288728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288728</guid><dc:creator><![CDATA[Michi 13]]></dc:creator><pubDate>Sun, 20 May 2007 20:19:08 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler beim vermeiden von automatischem schliessen on Sun, 20 May 2007 20:28:21 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">cin.get();
</code></pre>
<p>Wartet auf eine Eingabe...dazu kann noch kommen dass du vlt durch deine Entwicklungsumgebung automatisch eine &quot;Bitte drücken Sie eine Taste&quot;-Meldung bekommst;)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288733</guid><dc:creator><![CDATA[Kuldren]]></dc:creator><pubDate>Sun, 20 May 2007 20:28:21 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler beim vermeiden von automatischem schliessen on Mon, 21 May 2007 03:46:58 GMT]]></title><description><![CDATA[<p>Hmm, koennte das Problem da an dem in_avail liegen? Hier im Forum hat man mir mal gesagt, das koenne Probleme versuchen Gab da ja irgendetwas a la numeric_limits das man da einfuegen sollte, weisz aber gerade nicht mehr, was es genau war.</p>
<p>EDIT: mist, in der Konsolenfaq ist es auch noch damit angegeben...<br />
Ich glaub sowas wie</p>
<pre><code class="language-cpp">cin.ignore(5787);
</code></pre>
<p>koennte auch funktionnieren... Na, einer wird es sicher gleich richtig hierhin schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288794</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288794</guid><dc:creator><![CDATA[Shinja]]></dc:creator><pubDate>Mon, 21 May 2007 03:46:58 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler beim vermeiden von automatischem schliessen on Mon, 21 May 2007 06:21:12 GMT]]></title><description><![CDATA[<p>ignore() hat zwei Parameter (maximale Anzahl (Default 1) und letztes Zeichen (Default EOF)), die du im Ernstfall beide angeben mußt - mit <code>cin.ignore(numeric_limits&lt;streamsize&gt;::max(),'\n');</code> solltest du auf jeden Fall auf der sicheren Seite sein.</p>
<p>(in_avial() gibt laut Standard die Zeichenzahl im Stream-Buffer an. Aber für für cin muß das nicht unbedingt der Tastaturpuffer des Systems sein)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288809</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288809</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 21 May 2007 06:21:12 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler beim vermeiden von automatischem schliessen on Mon, 21 May 2007 06:28:47 GMT]]></title><description><![CDATA[<p>Ich wollte in meinem vorigen Beitrag eigentlich erst schreiben:<br />
&quot;Aber CStoll wird das sicher gleich korrigieren&quot;, habe dann aber doch gezweifelt, lol. War da nicht irgendwas wie &quot;Du sollst nicht zweifeln an deines Gottes Macht&quot; oder so?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288814</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288814</guid><dc:creator><![CDATA[Shinja]]></dc:creator><pubDate>Mon, 21 May 2007 06:28:47 GMT</pubDate></item></channel></rss>