<?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[C++ if Abfrage]]></title><description><![CDATA[<p>Wer kann mir bitte helfen?<br />
Bei der Eingabe einer Zahl unter 10 (&lt;&lt; cin Zahl) bekomme ich kein Ergenis!<br />
Bei einer Zahl über 10 klappt es.<br />
Woran liegt das?</p>
<p>Besten Dank schon einmal für Eure Hilfe!<br />
Soelg</p>
<p>#include &lt;iostream&gt;<br />
#include &lt;stdio.h&gt;</p>
<p>using namespace std;</p>
<p>int main()<br />
{<br />
int Zahl;</p>
<p>cout &lt;&lt;&quot;Bitte geben Sie eine Zahl ein!: &quot;;<br />
getchar();<br />
cin &gt;&gt; Zahl;<br />
getchar();<br />
if (Zahl &lt;50 )<br />
{<br />
cout &lt;&lt; &quot;Zahl ist kleiner als 50!\n&quot;;<br />
}<br />
getchar();<br />
return 0;</p>
<p>}</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/312734/c-if-abfrage</link><generator>RSS for Node</generator><lastBuildDate>Sun, 02 Aug 2026 19:36:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/312734.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 12 Jan 2013 19:14:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to C++ if Abfrage on Sat, 12 Jan 2013 19:14:21 GMT]]></title><description><![CDATA[<p>Wer kann mir bitte helfen?<br />
Bei der Eingabe einer Zahl unter 10 (&lt;&lt; cin Zahl) bekomme ich kein Ergenis!<br />
Bei einer Zahl über 10 klappt es.<br />
Woran liegt das?</p>
<p>Besten Dank schon einmal für Eure Hilfe!<br />
Soelg</p>
<p>#include &lt;iostream&gt;<br />
#include &lt;stdio.h&gt;</p>
<p>using namespace std;</p>
<p>int main()<br />
{<br />
int Zahl;</p>
<p>cout &lt;&lt;&quot;Bitte geben Sie eine Zahl ein!: &quot;;<br />
getchar();<br />
cin &gt;&gt; Zahl;<br />
getchar();<br />
if (Zahl &lt;50 )<br />
{<br />
cout &lt;&lt; &quot;Zahl ist kleiner als 50!\n&quot;;<br />
}<br />
getchar();<br />
return 0;</p>
<p>}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2289080</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2289080</guid><dc:creator><![CDATA[Soelg]]></dc:creator><pubDate>Sat, 12 Jan 2013 19:14:21 GMT</pubDate></item><item><title><![CDATA[Reply to C++ if Abfrage on Sat, 12 Jan 2013 19:21:44 GMT]]></title><description><![CDATA[<p>lass mal das getchar() weg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2289083</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2289083</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sat, 12 Jan 2013 19:21:44 GMT</pubDate></item><item><title><![CDATA[Reply to C++ if Abfrage on Sun, 13 Jan 2013 13:54:41 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/u100590" rel="nofollow">Martin Richter</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/f1" rel="nofollow">MFC (Visual C++)</a> in das Forum <a href="http://www.c-plusplus.net/forum/f15" rel="nofollow">C++ (auch C++0x und C++11)</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2289268</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2289268</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sun, 13 Jan 2013 13:54:41 GMT</pubDate></item><item><title><![CDATA[Reply to C++ if Abfrage on Sun, 13 Jan 2013 17:42:50 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>lass mal das getchar() weg.</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /><br />
Man darf nie unformatierte und formatierte Extraktion mischen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2289325</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2289325</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sun, 13 Jan 2013 17:42:50 GMT</pubDate></item><item><title><![CDATA[Reply to C++ if Abfrage on Sun, 13 Jan 2013 17:46:51 GMT]]></title><description><![CDATA[<blockquote>
<p>Woran liegt das?</p>
</blockquote>
<p>Ganz offensichtlich daran, dass nur ein Zeichen eingegeben wird und dadurch <code>std::cin</code> nur an das newline gelangt. Dadurch kann keine Zahl extrahiert werden, und <code>Zahl</code> bleibt unverändert dem Zufall überlassen.</p>
<p>Obwohl, ich denke, <code>num_get</code> könnte da auch 0 zurückgeben. Suche mal den Standard auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2289327</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2289327</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sun, 13 Jan 2013 17:46:51 GMT</pubDate></item><item><title><![CDATA[Reply to C++ if Abfrage on Sun, 13 Jan 2013 17:52:21 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Obwohl, ich denke, <code>num_get</code> könnte da auch 0 zurückgeben. Suche mal den Standard auf.</p>
</blockquote>
<p>Jo, ist tatsächlich definiert:</p>
<p>&lt;a href= schrieb:</p>
<blockquote>
<p>N3337 §22.4.2.1.2 Stage 3&quot;&gt;The numeric value to be stored can be one of:</p>
<ul>
<li>zero, if the conversion function fails to convert the entire field. ios_base::failbit is assigned<br />
to err.</li>
<li>...</li>
</ul>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2289331</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2289331</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sun, 13 Jan 2013 17:52:21 GMT</pubDate></item></channel></rss>