<?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[Es hängt etwas im eingabestrom!]]></title><description><![CDATA[<p>Hallo,</p>
<p>habe ein kleines Problem:</p>
<pre><code class="language-cpp">int main()
	{	
		char op,wahl='j';
		bruch b1,b2,erg;
		int ggt;
		do
		{	
		cout&lt;&lt;&quot;Programm Bruchrechnung&quot;&lt;&lt;endl;
		cout&lt;&lt;&quot;Eingabe des 1. Bruches:&quot;&lt;&lt;endl;
	    eingabe(b1);
	    cout&lt;&lt;&quot;Eingabe des 2. Bruches:&quot;&lt;&lt;endl;
	    eingabe(b2);
	    operator_eingeben(op);
	    erg= berechne(op, b1, b2);
		ausgabe(erg);
		cout&lt;&lt;&quot;\ngekuertzt:\n&quot;;
		kuerzen(erg);
		ausgabe(erg);
		cout&lt;&lt;&quot;\n\nProgramm beenden (j/n)?&quot;&lt;&lt;endl;
		cin.get(wahl);
		}
		while (wahl != 'j' &amp;&amp; wahl != 'J');
		return 0;
	}
</code></pre>
<p>bei der Abfrag Programm beenden frägt das Programm leider nicht nach...<br />
ich denke er schreibt ungewöhnlich ein leerzeichen in wahl... auch wenn ich</p>
<pre><code class="language-cpp">cin.get(wahl);
</code></pre>
<p>mehrmals anwende kann ich zwar ein zeichen eingeben aber trotzdem bricht er bei &quot;j&quot; nicht ab...</p>
<p>kann mir wer erklären warum nciht?</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/225888/es-hängt-etwas-im-eingabestrom</link><generator>RSS for Node</generator><lastBuildDate>Thu, 01 Oct 2026 08:06:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/225888.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 26 Oct 2008 15:05:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Es hängt etwas im eingabestrom! on Sun, 26 Oct 2008 15:05:47 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>habe ein kleines Problem:</p>
<pre><code class="language-cpp">int main()
	{	
		char op,wahl='j';
		bruch b1,b2,erg;
		int ggt;
		do
		{	
		cout&lt;&lt;&quot;Programm Bruchrechnung&quot;&lt;&lt;endl;
		cout&lt;&lt;&quot;Eingabe des 1. Bruches:&quot;&lt;&lt;endl;
	    eingabe(b1);
	    cout&lt;&lt;&quot;Eingabe des 2. Bruches:&quot;&lt;&lt;endl;
	    eingabe(b2);
	    operator_eingeben(op);
	    erg= berechne(op, b1, b2);
		ausgabe(erg);
		cout&lt;&lt;&quot;\ngekuertzt:\n&quot;;
		kuerzen(erg);
		ausgabe(erg);
		cout&lt;&lt;&quot;\n\nProgramm beenden (j/n)?&quot;&lt;&lt;endl;
		cin.get(wahl);
		}
		while (wahl != 'j' &amp;&amp; wahl != 'J');
		return 0;
	}
</code></pre>
<p>bei der Abfrag Programm beenden frägt das Programm leider nicht nach...<br />
ich denke er schreibt ungewöhnlich ein leerzeichen in wahl... auch wenn ich</p>
<pre><code class="language-cpp">cin.get(wahl);
</code></pre>
<p>mehrmals anwende kann ich zwar ein zeichen eingeben aber trotzdem bricht er bei &quot;j&quot; nicht ab...</p>
<p>kann mir wer erklären warum nciht?</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1605116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1605116</guid><dc:creator><![CDATA[Gustl]]></dc:creator><pubDate>Sun, 26 Oct 2008 15:05:47 GMT</pubDate></item><item><title><![CDATA[Reply to Es hängt etwas im eingabestrom! on Sun, 26 Oct 2008 15:52:02 GMT]]></title><description><![CDATA[<p>versuch vorher mal den Mist cin rauszuholen der da noch drin ist, mit cin.clear z.B.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1605133</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1605133</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Sun, 26 Oct 2008 15:52:02 GMT</pubDate></item><item><title><![CDATA[Reply to Es hängt etwas im eingabestrom! on Sun, 26 Oct 2008 16:02:10 GMT]]></title><description><![CDATA[<p>hab ich mit cin.clear(); probiert, hilft leider nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1605138</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1605138</guid><dc:creator><![CDATA[Gustl]]></dc:creator><pubDate>Sun, 26 Oct 2008 16:02:10 GMT</pubDate></item><item><title><![CDATA[Reply to Es hängt etwas im eingabestrom! on Sun, 26 Oct 2008 16:05:32 GMT]]></title><description><![CDATA[<p>gleiches problem hier:</p>
<pre><code class="language-cpp">inhalt i1; //struktur
cout&lt;&lt;&quot;Kapitel:&quot;;
cin&lt;&lt;i1.kapitel;
cout&lt;&lt;&quot;Thema:&quot;;
cin.getline(i1.thema,100);
</code></pre>
<p>er springt einfach über thema drüber...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1605141</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1605141</guid><dc:creator><![CDATA[Gustl]]></dc:creator><pubDate>Sun, 26 Oct 2008 16:05:32 GMT</pubDate></item><item><title><![CDATA[Reply to Es hängt etwas im eingabestrom! on Sun, 26 Oct 2008 16:07:55 GMT]]></title><description><![CDATA[<p>cin.clear() setzt auch nur die Flags zurück.</p>
<pre><code class="language-cpp">cin.clear();
cin.ignore(numeric_limits&lt;streamsize&gt;::max(), '\n');
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1605144</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1605144</guid><dc:creator><![CDATA[JustAnotherNoob]]></dc:creator><pubDate>Sun, 26 Oct 2008 16:07:55 GMT</pubDate></item><item><title><![CDATA[Reply to Es hängt etwas im eingabestrom! on Sun, 26 Oct 2008 16:22:29 GMT]]></title><description><![CDATA[<p>mit</p>
<pre><code class="language-cpp">cin.ignore();
</code></pre>
<p>funktionierts, danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Edit: &quot;justanothernoob&quot;^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1605149</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1605149</guid><dc:creator><![CDATA[Gustl]]></dc:creator><pubDate>Sun, 26 Oct 2008 16:22:29 GMT</pubDate></item><item><title><![CDATA[Reply to Es hängt etwas im eingabestrom! on Sun, 26 Oct 2008 16:49:55 GMT]]></title><description><![CDATA[<p>cin.ignore() ohne Parameter, funktioniert aber nur, wenn das New Line Zeichen(oder irgendein anderes Byte) das einzige war, dass noch im Buffer war.<br />
Mit den Parametern wird alles bis einschließlich dem nächsten new line Zeichen geleert.(Müsstest aber evtl &lt;limits&gt; inkludieren)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1605160</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1605160</guid><dc:creator><![CDATA[JustAnotherNoob]]></dc:creator><pubDate>Sun, 26 Oct 2008 16:49:55 GMT</pubDate></item><item><title><![CDATA[Reply to Es hängt etwas im eingabestrom! on Sun, 26 Oct 2008 17:00:55 GMT]]></title><description><![CDATA[<p>Gustl schrieb:</p>
<blockquote>
<p>gleiches problem hier:</p>
<pre><code class="language-cpp">inhalt i1; //struktur
cout&lt;&lt;&quot;Kapitel:&quot;;
cin&lt;&lt;i1.kapitel;
cout&lt;&lt;&quot;Thema:&quot;;
cin.getline(i1.thema,100);
</code></pre>
<p>er springt einfach über thema drüber...</p>
</blockquote>
<p>Entschuldigt, wenn ich mich irre, aber heißt es nicht</p>
<pre><code class="language-cpp">cin&gt;&gt;i1.kapitel;
</code></pre>
<p>anstelle von</p>
<pre><code class="language-cpp">cin&lt;&lt;i1.kapitel;
</code></pre>
<p>? Wäre das nicht eine viel einfachere Lösung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1605164</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1605164</guid><dc:creator><![CDATA[KeksX]]></dc:creator><pubDate>Sun, 26 Oct 2008 17:00:55 GMT</pubDate></item><item><title><![CDATA[Reply to Es hängt etwas im eingabestrom! on Sun, 26 Oct 2008 17:29:01 GMT]]></title><description><![CDATA[<p>KeksX schrieb:</p>
<blockquote>
<p>Gustl schrieb:</p>
<blockquote>
<p>gleiches problem hier:</p>
<pre><code class="language-cpp">inhalt i1; //struktur
cout&lt;&lt;&quot;Kapitel:&quot;;
cin&lt;&lt;i1.kapitel;
cout&lt;&lt;&quot;Thema:&quot;;
cin.getline(i1.thema,100);
</code></pre>
<p>er springt einfach über thema drüber...</p>
</blockquote>
<p>Entschuldigt, wenn ich mich irre, aber heißt es nicht</p>
<pre><code class="language-cpp">cin&gt;&gt;i1.kapitel;
</code></pre>
<p>anstelle von</p>
<pre><code class="language-cpp">cin&lt;&lt;i1.kapitel;
</code></pre>
<p>? Wäre das nicht eine viel einfachere Lösung?</p>
</blockquote>
<p>ja, ich habs kurz vom lappi abgeschrieben, hab mich da verschrieben...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1605176</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1605176</guid><dc:creator><![CDATA[Gustl]]></dc:creator><pubDate>Sun, 26 Oct 2008 17:29:01 GMT</pubDate></item></channel></rss>