<?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++ Problem]]></title><description><![CDATA[<p>Grüße, liebe Community,<br />
ich habe gestern angefangen, mich an c++ ranzusetzen.</p>
<p>Ich habe bereits einen COmpiler (MinGW), habe eine .exe Datei. wenn ich diese aber nun ausführe, kommt ja die eingabeaufforderung:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
    using namespace std;

    int main()
{
cout&lt;&lt;&quot;Bitte geben Sie eine Zahl ein\n&quot;;
int  a;
cin&gt;&gt;a;
    if(a==1)
    {
        cout&lt;&lt;&quot;Die Zahl ist 1 \n&quot;;
    }
    else if(a==2)
    {
        cout&lt;&lt;&quot;Die Zahl ist 2 \n&quot;;
    }
    else if(a==3)
    {
        cout&lt;&lt;&quot;Die Zahl ist 3 \n&quot;;
    }
    else if(a==4)
    {
        cout&lt;&lt;&quot;Die Zahl ist 4 \n&quot;;
    }
    else if(a==5)
    {
        cout&lt;&lt;&quot;Die Zahl ist 5 \n&quot;;
    }
    else if(a==6)
    {
        cout&lt;&lt;&quot;Die Zahl ist 6 \n&quot;;
    }
    else if(a==7)
    {
        cout&lt;&lt;&quot;Die Zahl ist 7 \n&quot;;
    }
    else if(a==8)
    {
        cout&lt;&lt;&quot;Die Zahl ist 8 \n&quot;;
    }
    else if(a==9)
    {
        cout&lt;&lt;&quot;Die Zahl ist 9 \n&quot;;
    }
    else if(a==10)

        cout&lt;&lt;&quot;Die Zahl ist 10 \n&quot;;
    }
</code></pre>
<p>(Das ist der Code)</p>
<p>Nur wenn ich eine Zahl eingebe und enter drücke, schließt sich die Konsole??</p>
<p>Wieso? Beim Compilen kam keine Fehlermeldung.....</p>
<p>Danke im vorraus,</p>
<p>Rubberducky</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/207149/c-problem</link><generator>RSS for Node</generator><lastBuildDate>Sun, 11 Oct 2026 01:15:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/207149.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Mar 2008 12:24:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to C++ Problem on Tue, 04 Mar 2008 12:24:25 GMT]]></title><description><![CDATA[<p>Grüße, liebe Community,<br />
ich habe gestern angefangen, mich an c++ ranzusetzen.</p>
<p>Ich habe bereits einen COmpiler (MinGW), habe eine .exe Datei. wenn ich diese aber nun ausführe, kommt ja die eingabeaufforderung:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
    using namespace std;

    int main()
{
cout&lt;&lt;&quot;Bitte geben Sie eine Zahl ein\n&quot;;
int  a;
cin&gt;&gt;a;
    if(a==1)
    {
        cout&lt;&lt;&quot;Die Zahl ist 1 \n&quot;;
    }
    else if(a==2)
    {
        cout&lt;&lt;&quot;Die Zahl ist 2 \n&quot;;
    }
    else if(a==3)
    {
        cout&lt;&lt;&quot;Die Zahl ist 3 \n&quot;;
    }
    else if(a==4)
    {
        cout&lt;&lt;&quot;Die Zahl ist 4 \n&quot;;
    }
    else if(a==5)
    {
        cout&lt;&lt;&quot;Die Zahl ist 5 \n&quot;;
    }
    else if(a==6)
    {
        cout&lt;&lt;&quot;Die Zahl ist 6 \n&quot;;
    }
    else if(a==7)
    {
        cout&lt;&lt;&quot;Die Zahl ist 7 \n&quot;;
    }
    else if(a==8)
    {
        cout&lt;&lt;&quot;Die Zahl ist 8 \n&quot;;
    }
    else if(a==9)
    {
        cout&lt;&lt;&quot;Die Zahl ist 9 \n&quot;;
    }
    else if(a==10)

        cout&lt;&lt;&quot;Die Zahl ist 10 \n&quot;;
    }
</code></pre>
<p>(Das ist der Code)</p>
<p>Nur wenn ich eine Zahl eingebe und enter drücke, schließt sich die Konsole??</p>
<p>Wieso? Beim Compilen kam keine Fehlermeldung.....</p>
<p>Danke im vorraus,</p>
<p>Rubberducky</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467929</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467929</guid><dc:creator><![CDATA[Rubberducky]]></dc:creator><pubDate>Tue, 04 Mar 2008 12:24:25 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Tue, 04 Mar 2008 12:29:17 GMT]]></title><description><![CDATA[<p>Das ist völlig normal. Dein Programm ist schließlich fertig, nachdem es den Text ausgegeben hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467931</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467931</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Tue, 04 Mar 2008 12:29:17 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Tue, 04 Mar 2008 12:31:48 GMT]]></title><description><![CDATA[<p>Kopf-&gt;Tisch</p>
<p>erstmal: Das du ein Problem mit C++ hast, sollte dadurch klar sein, dass du hier einen Thread eröffnest... Die Überschrift kann man dann für weit sinnvollere Problembeschreibungen nutzen.</p>
<p>zweitens: FAQ lesen. Die Konsole schließt sich, weil dein Programm fertig ist. Und Programme, die fertig sind haben keinen Grund, noch weiter geöffnet zu sein</p>
<p>drittens:</p>
<pre><code>#include &lt;iostream&gt;
    using namespace std;

int main()
{
    cout&lt;&lt;&quot;Bitte geben Sie eine Zahl ein&quot;;
    int  a;
    cin&gt;&gt;a;
    cout&lt;&lt;&quot;Die Zahl ist &quot; &lt;&lt; a &lt;&lt; endl;
}
</code></pre>
<p>viertens: voraus, nicht vorraus (ein r)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467933</guid><dc:creator><![CDATA[zwutz]]></dc:creator><pubDate>Tue, 04 Mar 2008 12:31:48 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Tue, 04 Mar 2008 12:32:42 GMT]]></title><description><![CDATA[<p>Ich möcht aber gerne, dass er die Lösung noch ausgibt. Also wenn ich da ne 5 eingebe, dass er dann sagt: Deine Zahl ist 5.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467936</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467936</guid><dc:creator><![CDATA[Rubberducky]]></dc:creator><pubDate>Tue, 04 Mar 2008 12:32:42 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Tue, 04 Mar 2008 12:35:09 GMT]]></title><description><![CDATA[<p>mach danach einfach noch nen cin</p>
<p>RTFM unso -.-</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467937</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467937</guid><dc:creator><![CDATA[zwutz]]></dc:creator><pubDate>Tue, 04 Mar 2008 12:35:09 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Tue, 04 Mar 2008 12:37:01 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-111042.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-111042.html</a> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467942</guid><dc:creator><![CDATA[Ryuzaki]]></dc:creator><pubDate>Tue, 04 Mar 2008 12:37:01 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Tue, 04 Mar 2008 12:44:20 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
    using namespace std;

int main()
{
    cout&lt;&lt;&quot;Bitte geben Sie eine Zahl ein&quot;;
    int  a;
    cin&gt;&gt;a;
    cout&lt;&lt;&quot;Die Zahl ist &quot; &lt;&lt; a &lt;&lt; endl;

    getchar(); // wartet bis der Anwender ein Taste drückt
}
</code></pre>
<p>Gruß</p>
<p>2²</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467953</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467953</guid><dc:creator><![CDATA[2²]]></dc:creator><pubDate>Tue, 04 Mar 2008 12:44:20 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Tue, 04 Mar 2008 13:40:49 GMT]]></title><description><![CDATA[<p>btw... meines Erachtens nach, sagt er dir, wenn du &quot;5&quot; drückst &quot;die Zahl ist 5&quot;. &quot;Er&quot; ( wer auch immer dieser abstrakte er ist, DER Konsole oder DER Programm könnens ja nicht sein ) &quot;sagt&quot; das Ganze nur so schnell, dass du es nicht siehst, aber &quot; er sagt &quot; es <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468007</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468007</guid><dc:creator><![CDATA[Vorden]]></dc:creator><pubDate>Tue, 04 Mar 2008 13:40:49 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Tue, 04 Mar 2008 19:12:12 GMT]]></title><description><![CDATA[<p>ist jetzt nicht unbedingt die direkte anwort auf deine Frage, aber ich glaube das eine switch anweisung besser wäre, da ich finde das diese else if einen verwirrt...</p>
<pre><code class="language-cpp">int main()
{
cout&lt;&lt;&quot;Bitte geben Sie eine Zahl ein\n&quot;;
int  a;
cin&gt;&gt;a;
switch(a)
{
     case 1: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 2: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 3: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 4: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 5: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 6: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 7: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 8: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 9: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 10: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     default: cout &lt;&lt; &quot;Du hast eine Falsche eingabe, oder eine eingabe über 10 gemacht\n&quot;;
}
system(&quot;PAUSE&quot;); //dies sollte dein Problem mit dem direkten beenden des Programms lösen
}
</code></pre>
<p>Wenn du deinen code aber unverändert lassen möchtest... füge einfach nach deinen ganzen else if....</p>
<pre><code class="language-cpp">system(&quot;PAUSE&quot;);
</code></pre>
<p>ein... das hat bei mir dieses Problem sehr praktisch gelöst...</p>
<p>PS: Wenn ich falsch liege korrigiert mich, aber die switch anweisung ist doch eigtl wesentlich effizienter oder??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468324</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468324</guid><dc:creator><![CDATA[Jud4s]]></dc:creator><pubDate>Tue, 04 Mar 2008 19:12:12 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Tue, 04 Mar 2008 19:16:14 GMT]]></title><description><![CDATA[<p>Jud4s schrieb:</p>
<blockquote>
<p>PS: Wenn ich falsch liege korrigiert mich, aber die switch anweisung ist doch eigtl wesentlich effizienter oder??</p>
</blockquote>
<p>Als das hier nicht :p</p>
<p>2² schrieb:</p>
<blockquote>
<p>cout&lt;&lt;&quot;Die Zahl ist &quot; &lt;&lt; a &lt;&lt; endl;</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1468328</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468328</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Tue, 04 Mar 2008 19:16:14 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 08:12:06 GMT]]></title><description><![CDATA[<blockquote>
<p>Jud4s schrieb:<br />
PS: Wenn ich falsch liege korrigiert mich, aber die switch anweisung ist doch eigtl wesentlich effizienter oder??</p>
<p>Als das hier nicht :p</p>
</blockquote>
<p>??Warum... finde meine idee mit dem switch wesentlich übersichtlicher <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468519</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468519</guid><dc:creator><![CDATA[Jud4s]]></dc:creator><pubDate>Wed, 05 Mar 2008 08:12:06 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 08:20:01 GMT]]></title><description><![CDATA[<p>Jud4s schrieb:</p>
<blockquote>
<pre><code class="language-cpp">int main()
{
cout&lt;&lt;&quot;Bitte geben Sie eine Zahl ein\n&quot;;
int  a;
cin&gt;&gt;a;
switch(a)
{
     case 1: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 2: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 3: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 4: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 5: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 6: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 7: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 8: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 9: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     case 10: cout&lt;&lt;&quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; &quot;\n&quot;;break;
     default: cout &lt;&lt; &quot;Du hast eine Falsche eingabe, oder eine eingabe über 10 gemacht\n&quot;;
}
system(&quot;PAUSE&quot;); //dies sollte dein Problem mit dem direkten beenden des Programms lösen
}
</code></pre>
</blockquote>
<p>*lach*<br />
nicht dein ernst, oder? ^^</p>
<p>Es ist zwar effizienter als das Eingangsbeispiel, aber im Grunde führst du nur 10mal den <em>exakt</em> gleichen Befehl aus.</p>
<p>ein (in Zahlen: 1) simpler cout reicht in dem Fall bei weitem aus (und vermeidet unnötige Redundanz)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468526</guid><dc:creator><![CDATA[zwutz]]></dc:creator><pubDate>Wed, 05 Mar 2008 08:20:01 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 08:24:41 GMT]]></title><description><![CDATA[<p>Hihi... ja es ist der gleiche nur, ihc meine das eingangsbeispiel ist doch auch das gleiche nur das ich stadt dessen ich bei den couts statt die Zahl von anfang an zu definieren einfach die Variable ausgebe.... aber gut du hast recht es ist fehleranfälliger... aber ich mag es lieber wenn es wenig Klammern gibt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468528</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468528</guid><dc:creator><![CDATA[Jud4s]]></dc:creator><pubDate>Wed, 05 Mar 2008 08:24:41 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 08:41:49 GMT]]></title><description><![CDATA[<p>sieh dir deinen code an:<br />
gebe ich &quot;1&quot; ein, so lautet die ausgabe &quot;Die Zahl ist1&quot;.<br />
dir fehlt also ein leerzeichen. was machst du nun? du musst den code insgesamt an zehn stellen ändern, nämlich bei jedem <code>case ...:</code> und überall ein leerzeichen eingeben.<br />
das ist ineffizient.</p>
<p>hättest du code wie folgenden gehabt:</p>
<pre><code class="language-cpp">unsigned int a;
cin &gt;&gt; a;

if (a &lt;= 10)
{
   cout &lt;&lt; &quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; '\n';
}
else
{
   cout &lt;&lt; &quot;Fehler: Eingabe darf nicht größer als 10 sein.\n&quot;;
}
</code></pre>
<p>dann müsstest du den code nur an einer stelle ändern.</p>
<p>/edit: jaja, die deutsche satzstellung...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468540</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468540</guid><dc:creator><![CDATA[queer_boy]]></dc:creator><pubDate>Wed, 05 Mar 2008 08:41:49 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 12:30:17 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">unsigned int a = 0;
std::cin &gt;&gt; a;

std::cout &lt;&lt; &quot;Die Zahl ist &quot; &lt;&lt; ( a &gt; 10 ? &quot;fehlerhaft&quot;: std::stringstream( a ).str() ) &lt;&lt; std::endl;
</code></pre>
<p>is untested <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1468736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468736</guid><dc:creator><![CDATA[Vorden]]></dc:creator><pubDate>Wed, 05 Mar 2008 12:30:17 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 13:06:48 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/14600">@queer_boy</a><br />
Bei deinem Code wird aber auch die 0 akzeptiert. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468759</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Wed, 05 Mar 2008 13:06:48 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 13:33:17 GMT]]></title><description><![CDATA[<p>Rubber les das hier mal:</p>
<p><a href="http://www.lerneniminternet.de/htm/c++/probe.html" rel="nofollow">http://www.lerneniminternet.de/htm/c++/probe.html</a></p>
<p>Da wird es erklärt.</p>
<p>Ich bin mir ganz sicher viele Leute hier in diesem Forum könnten die innerhalb von 10 min die richtige Antwort posten.</p>
<p>Aber irgendwie macht das hier keiner dir werden eigentlich nur hinweise gegeben wie du es machen könntest.</p>
<p>Ich find das manchmal etwas blöd.</p>
<p>Weil wenn man an einer Sache schon wer weiss wie lange dran sitzt und es einfach net hinbekommt dann macht es auch irgendwann kein spass mehr.</p>
<p>Dann wäre man schon froh über eine Antwort.^^</p>
<p>Warum ich dir keine direkte Antwort geben: Weil ich auch net auf anhieb weiss wie es geht^^</p>
<p>Aber viele hier im Forum wüssten es da bin ich mir ganz sicher.</p>
<p>naja hf &amp; gl :&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468777</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468777</guid><dc:creator><![CDATA[Bassmaster]]></dc:creator><pubDate>Wed, 05 Mar 2008 13:33:17 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 14:17:57 GMT]]></title><description><![CDATA[<p>std::stringstream hat nen Konstruktor der nicht für std::string ist? Naja ... mein nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<pre><code class="language-cpp">unsigned int value(0);
std::cin &gt;&gt; value;

std::cout &lt;&lt; &quot;Die Zahl ist &quot;;
if (value &lt; 0 || value &gt; 10)
    std::cout &lt;&lt;  &quot;fehlerhaft!\n&quot;;
else 
    std::cout &lt;&lt; value &lt;&lt; std::endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1468802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468802</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Wed, 05 Mar 2008 14:17:57 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 14:45:37 GMT]]></title><description><![CDATA[<p>Haha... Dachte schon auf der letzten Seite, was es da noch gross was am Code zu ändern gibt, nachdem</p>
<pre><code class="language-cpp">cout &lt;&lt; &quot;Die Zahl ist&quot; &lt;&lt; a &lt;&lt; '\n';
</code></pre>
<p>geschrieben worden ist.. - Und jetzt diese Disskusion. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468820</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Wed, 05 Mar 2008 14:45:37 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 14:51:18 GMT]]></title><description><![CDATA[<p>(D)Evil schrieb:</p>
<blockquote>
<p>std::stringstream hat nen Konstruktor der nicht für std::string ist? Naja ... mein nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<pre><code class="language-cpp">unsigned int value(0);
std::cin &gt;&gt; value;

std::cout &lt;&lt; &quot;Die Zahl ist &quot;;
if (value &lt; 0 || value &gt; 10)
    std::cout &lt;&lt;  &quot;fehlerhaft!\n&quot;;
else 
    std::cout &lt;&lt; value &lt;&lt; std::endl;
</code></pre>
</blockquote>
<p>Es müsste value &lt;= 0 heißen. :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468824</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468824</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Wed, 05 Mar 2008 14:51:18 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 16:34:57 GMT]]></title><description><![CDATA[<p>(D)Evil schrieb:</p>
<blockquote>
<p>std::stringstream hat nen Konstruktor der nicht für std::string ist? Naja ... mein nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
</blockquote>
<p>Nö, aber so ähnlich geht es:</p>
<pre><code class="language-cpp">std::cout &lt;&lt; &quot;Die Zahl ist &quot; &lt;&lt; (a &gt; 10 ? &quot;fehlerhaft&quot; : static_cast&lt;std::stringstream&amp;&gt;(std::stringstream() &lt;&lt; a).str()) &lt;&lt; std::endl;
</code></pre>
<p>Nicht, dass ich sowas empfehlen würde. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";-)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468905</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468905</guid><dc:creator><![CDATA[Konrad Rudolph]]></dc:creator><pubDate>Wed, 05 Mar 2008 16:34:57 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 16:36:42 GMT]]></title><description><![CDATA[<p>wo ist der kotz-smilie?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468908</guid><dc:creator><![CDATA[pfui]]></dc:creator><pubDate>Wed, 05 Mar 2008 16:36:42 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Problem on Wed, 05 Mar 2008 17:27:09 GMT]]></title><description><![CDATA[<p>Hmm nee eigtl. != 0 <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Denn unsigned kann nicht negativ sein <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> Sorry <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468940</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468940</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Wed, 05 Mar 2008 17:27:09 GMT</pubDate></item></channel></rss>