<?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[Konsolenfenster schließt automatisch]]></title><description><![CDATA[<p>Hallo,<br />
ich habe ein Programm programmiert wo man eine kommazahl eingeben muss, daher habe ich die variable double benutzt...</p>
<p>Problem: Wenn ich nun eine kommazahl eingebe beendet sich das proggy automatisch, why?</p>
<p>Der Code:</p>
<pre><code class="language-cpp">// Programmiert von Nadim Hammoud
#include&lt;iostream&gt;
using namespace std;

int main()

{
    cout&lt;&lt;&quot;Mit WERBE!RECHNER! kannst du den ungefaehren Verdienst mit deiner Seite mit\nWerbung ausrechnen\n&quot;;
    cout&lt;&lt;&quot;Bitte waehle: (1) Adsense, (2) Bannerwerbung, (3) Layer, (4) Layer und Popup\n&quot;;
    int wahl;
    cin&gt;&gt;wahl;

    double a;
    double b;
    double c;

    switch(wahl)
    {
    case 1: cout&lt;&lt;&quot;Bitte gebe die Klickrate ein (meisst 1,5)\n(Bei 1,5 bitte 0,015 eingeben usw., sonst falsches Ergebnis!): &quot;;
    cin&gt;&gt;a;
    cout&lt;&lt;&quot;Bitte gebe deine Besucheranzahl pro Tag ein: &quot;;
    cin&gt;&gt;b;
    cout&lt;&lt;&quot;Bitte gebe den Verdienst pro Klick ein: &quot;;
    cin&gt;&gt;c;
    cout&lt;&lt;&quot;Du verdienst pro Tag betraegt ca.:&quot;&lt;&lt;a*b*c&lt;&lt;&quot; Euro&quot;;
    break;;

    case 2: cout&lt;&lt;&quot;Bitte gebe die Klickrate ein (meisst 2,0)\n(Bei 2,0 bitte 0,2 eingeben usw., sonst falsches Ergebnis!): &quot;;
    cin&gt;&gt;a;
    cout&lt;&lt;&quot;Bitte gebe deine Besucheranzahl pro Tag ein: &quot;;
    cin&gt;&gt;b;
    cout&lt;&lt;&quot;Bitte gebe den Verdienst pro Klick ein: &quot;;
    cin&gt;&gt;c;
    cout&lt;&lt;&quot;Du verdienst pro Tag betraegt ca.:&quot;&lt;&lt;a*b*c&lt;&lt;&quot; Euro&quot;;
    break;

    case 3: cout&lt;&lt;&quot;Bitte gebe deine Besucheranzahl pro Tag ein: &quot;;
    cin&gt;&gt;a;
    cout&lt;&lt;&quot;Bitte gebe den Verdienst pro Einblendung ein: &quot;;
    cin&gt;&gt;b;
    cout&lt;&lt;&quot;Du verdienst pro Tag betraegt ca.:&quot;&lt;&lt;a*b*c&lt;&lt;&quot; Cent&quot;;
    break;

    case 4: cout&lt;&lt;&quot;Bitte gebe deine Besucheranzahl pro Tag ein: &quot;;
    cin&gt;&gt;a;
    cout&lt;&lt;&quot;Bitte gebe den Verdienst pro Einblendung ein: &quot;;
    cin&gt;&gt;b;
    cout&lt;&lt;&quot;Du verdienst pro Tag betraegt ca.:&quot;&lt;&lt;a*b*c&lt;&lt;&quot; Cent&quot;;
    break;

    default: cout&lt;&lt;&quot;Es ist ein Fehler aufgetreten. Versuch es doch noch einmal!&quot;;
    break;

    }
    cout&lt;&lt;&quot;\n&quot;;

    	std::cin.ignore(std::numeric_limits&lt;std::streamsize&gt;::max(), '\n').get();

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/202088/konsolenfenster-schließt-automatisch</link><generator>RSS for Node</generator><lastBuildDate>Tue, 06 Oct 2026 13:06:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/202088.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 07 Jan 2008 14:28:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Konsolenfenster schließt automatisch on Mon, 07 Jan 2008 14:44:05 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich habe ein Programm programmiert wo man eine kommazahl eingeben muss, daher habe ich die variable double benutzt...</p>
<p>Problem: Wenn ich nun eine kommazahl eingebe beendet sich das proggy automatisch, why?</p>
<p>Der Code:</p>
<pre><code class="language-cpp">// Programmiert von Nadim Hammoud
#include&lt;iostream&gt;
using namespace std;

int main()

{
    cout&lt;&lt;&quot;Mit WERBE!RECHNER! kannst du den ungefaehren Verdienst mit deiner Seite mit\nWerbung ausrechnen\n&quot;;
    cout&lt;&lt;&quot;Bitte waehle: (1) Adsense, (2) Bannerwerbung, (3) Layer, (4) Layer und Popup\n&quot;;
    int wahl;
    cin&gt;&gt;wahl;

    double a;
    double b;
    double c;

    switch(wahl)
    {
    case 1: cout&lt;&lt;&quot;Bitte gebe die Klickrate ein (meisst 1,5)\n(Bei 1,5 bitte 0,015 eingeben usw., sonst falsches Ergebnis!): &quot;;
    cin&gt;&gt;a;
    cout&lt;&lt;&quot;Bitte gebe deine Besucheranzahl pro Tag ein: &quot;;
    cin&gt;&gt;b;
    cout&lt;&lt;&quot;Bitte gebe den Verdienst pro Klick ein: &quot;;
    cin&gt;&gt;c;
    cout&lt;&lt;&quot;Du verdienst pro Tag betraegt ca.:&quot;&lt;&lt;a*b*c&lt;&lt;&quot; Euro&quot;;
    break;;

    case 2: cout&lt;&lt;&quot;Bitte gebe die Klickrate ein (meisst 2,0)\n(Bei 2,0 bitte 0,2 eingeben usw., sonst falsches Ergebnis!): &quot;;
    cin&gt;&gt;a;
    cout&lt;&lt;&quot;Bitte gebe deine Besucheranzahl pro Tag ein: &quot;;
    cin&gt;&gt;b;
    cout&lt;&lt;&quot;Bitte gebe den Verdienst pro Klick ein: &quot;;
    cin&gt;&gt;c;
    cout&lt;&lt;&quot;Du verdienst pro Tag betraegt ca.:&quot;&lt;&lt;a*b*c&lt;&lt;&quot; Euro&quot;;
    break;

    case 3: cout&lt;&lt;&quot;Bitte gebe deine Besucheranzahl pro Tag ein: &quot;;
    cin&gt;&gt;a;
    cout&lt;&lt;&quot;Bitte gebe den Verdienst pro Einblendung ein: &quot;;
    cin&gt;&gt;b;
    cout&lt;&lt;&quot;Du verdienst pro Tag betraegt ca.:&quot;&lt;&lt;a*b*c&lt;&lt;&quot; Cent&quot;;
    break;

    case 4: cout&lt;&lt;&quot;Bitte gebe deine Besucheranzahl pro Tag ein: &quot;;
    cin&gt;&gt;a;
    cout&lt;&lt;&quot;Bitte gebe den Verdienst pro Einblendung ein: &quot;;
    cin&gt;&gt;b;
    cout&lt;&lt;&quot;Du verdienst pro Tag betraegt ca.:&quot;&lt;&lt;a*b*c&lt;&lt;&quot; Cent&quot;;
    break;

    default: cout&lt;&lt;&quot;Es ist ein Fehler aufgetreten. Versuch es doch noch einmal!&quot;;
    break;

    }
    cout&lt;&lt;&quot;\n&quot;;

    	std::cin.ignore(std::numeric_limits&lt;std::streamsize&gt;::max(), '\n').get();

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1432444</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432444</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 07 Jan 2008 14:44:05 GMT</pubDate></item><item><title><![CDATA[Reply to Konsolenfenster schließt automatisch on Mon, 07 Jan 2008 14:42:43 GMT]]></title><description><![CDATA[<p>Nedem schrieb:</p>
<blockquote>
<p>...<br />
Problem: Wenn ich nun eine kommazahl eingebe beendet sich das proggy automatisch, why?...</p>
</blockquote>
<p>Was sollte es denn sonst tun, wenn es &quot;fertig hat&quot; ?</p>
<p>Ich vermute, dass Du die &quot;kommazahl&quot; mit einem ',' statt einem '.' schreibst, weswegen &quot;cin &gt;&gt; a;&quot; bereits fehlschlägt und (da Du cin nicht wieder &quot;in Ordnung bringst&quot;) damit auch alle folgenden &quot;cin &gt;&gt;&quot;.</p>
<p>Erstmal Du mal den FAQ-Artikel &quot;Konsolenfenster schließt automatisch&quot; durchlesen, Deinen Thread etwas sinnvoller benennen (geht mit &quot;editieren&quot;)<br />
... und Dir schleunigst abgewöhnen, Programme &quot;proggies&quot; zu nennen ... das hat hier im Forum einen &quot;1337-Faktor von minus unendlich&quot;. <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>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432456</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432456</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Mon, 07 Jan 2008 14:42:43 GMT</pubDate></item><item><title><![CDATA[Reply to Konsolenfenster schließt automatisch on Mon, 07 Jan 2008 14:44:51 GMT]]></title><description><![CDATA[<ul>
<li></li>
</ul>
]]></description><link>https://www.c-plusplus.net/forum/post/1432458</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432458</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 07 Jan 2008 14:44:51 GMT</pubDate></item><item><title><![CDATA[Reply to Konsolenfenster schließt automatisch on Mon, 07 Jan 2008 14:44:35 GMT]]></title><description><![CDATA[<p>Simon2 schrieb:</p>
<blockquote>
<p>Nedem schrieb:</p>
<blockquote>
<p>...<br />
Problem: Wenn ich nun eine kommazahl eingebe beendet sich das proggy automatisch, why?...</p>
</blockquote>
<p>Was sollte es denn sonst tun, wenn es &quot;fertig hat&quot; ?</p>
<p>Ich vermute, dass Du die &quot;kommazahl&quot; mit einem ',' statt einem '.' schreibst, weswegen &quot;cin &gt;&gt; a;&quot; bereits fehlschlägt und (da Du cin nicht wieder &quot;in Ordnung bringst&quot;) damit auch alle folgenden &quot;cin &gt;&gt;&quot;.</p>
<p>Erstmal Du mal den FAQ-Artikel &quot;Konsolenfenster schließt automatisch&quot; durchlesen, Deinen Thread etwas sinnvoller benennen (geht mit &quot;editieren&quot;)<br />
... und Dir schleunigst abgewöhnen, Programme &quot;proggies&quot; zu nennen ... das hat hier im Forum einen &quot;1337-Faktor von minus unendlich&quot;. <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>Gruß,</p>
<p>Simon2.</p>
</blockquote>
<p>Hmmm ok und was muss ich nun ändern ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432459</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432459</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 07 Jan 2008 14:44:35 GMT</pubDate></item><item><title><![CDATA[Reply to Konsolenfenster schließt automatisch on Mon, 07 Jan 2008 14:47:19 GMT]]></title><description><![CDATA[<p>Nedem schrieb:</p>
<blockquote>
<p>...</p>
<p>Hmmm ok und was muss ich nun ändern ?</p>
</blockquote>
<p>1. statt 2,3 mal 2.3 eingeben<br />
2. <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-151578.html" rel="nofollow">Die meist-gestellten Fragen</a> durchlesen.</p>
<p>(Sorry, hieß nicht &quot;Konsolenfenster schließt automatisch&quot; ... so heißt nun dieser Thread)</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432464</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432464</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Mon, 07 Jan 2008 14:47:19 GMT</pubDate></item><item><title><![CDATA[Reply to Konsolenfenster schließt automatisch on Mon, 07 Jan 2008 14:49:27 GMT]]></title><description><![CDATA[<p>Simon2 schrieb:</p>
<blockquote>
<p>Nedem schrieb:</p>
<blockquote>
<p>...</p>
<p>Hmmm ok und was muss ich nun ändern ?</p>
</blockquote>
<p>1. statt 2,3 mal 2.3 eingeben<br />
2. <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-151578.html" rel="nofollow">Die meist-gestellten Fragen</a> durchlesen.</p>
<p>(Sorry, hieß nicht &quot;Konsolenfenster schließt automatisch&quot; ... so heißt nun dieser Thread)</p>
<p>Gruß,</p>
<p>Simon2.</p>
</blockquote>
<p>Hey, super,funktioniert, danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432465</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432465</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 07 Jan 2008 14:49:27 GMT</pubDate></item><item><title><![CDATA[Reply to Konsolenfenster schließt automatisch on Mon, 07 Jan 2008 14:55:57 GMT]]></title><description><![CDATA[<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 />
Gern geschehen !!<br />
Danke für die Rückmeldung,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432469</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432469</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Mon, 07 Jan 2008 14:55:57 GMT</pubDate></item></channel></rss>