<?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[While-Schleife]]></title><description><![CDATA[<p>Hi Leute<br />
Ich bin noch ein C++-Neuling und lerne mit einem Buch. Leider funktioniert die While-Schleife nicht wie sie sollte aus einem Grund den ich nicht verstehe. Mit den Fehlern kann ich auch nicht viel anfangen.<br />
Hier der Code:</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

int main ()
{
	int Auswahl = 0;

	while (Auswahl != 3)
	{
		cout &lt;&lt;&quot;Menue:&quot;&lt;&lt;endl;
		cout &lt;&lt;&quot;------&quot;&lt;&lt;endl;
		cout &lt;&lt;&quot;1: Spiel starten&quot;&lt;&lt;endl;
		cout &lt;&lt;&quot;2: Optionen&quot;&lt;&lt;endl;
		cout &lt;&lt;&quot;3: Spiel beenden&quot;&lt;&lt;endl;

		cout &lt;&lt;&quot;Deine Wahl: &quot;&lt;&lt;endl;
		cin &gt;&gt; Auswahl;

		if (Auswahl == 1)
		{
        cout &lt;&lt;&quot;&gt; Das Spiel wird gestartet &lt;&quot;&lt;&lt;endl;
		}

		if (Auswahl == 2)
		{
        cout &lt;&lt;&quot;&gt; Optionen werden eingestellt &lt;&quot;&lt;&lt;endl;
		}

		if (Auswahl == 3)
		{
        cout &lt;&lt;&quot;&gt; Das Spiel wird beendet &lt;&quot;endl;
		}

		else
		{
        cout &lt;&lt;&quot;&gt; Falsche Eingabe &lt;&quot;endl;
		}

		cout &lt;&lt;&quot;\n\n\n&quot;&lt;&lt;endl;
	}
	return 0;
	system (&quot;pause&quot;);
</code></pre>
<p>}</p>
<p>Und hier ist der Fehler:<br />
1&gt;c:\users\daniel spiele\documents\visual studio 2010\projects\while-schleife\while-schleife\while-schleife.cpp(32): error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'endl'<br />
1&gt;c:\users\daniel spiele\documents\visual studio 2010\projects\while-schleife\while-schleife\while-schleife.cpp(32): warning C4551: Dem Funktionsaufruf fehlt die Argumentliste<br />
1&gt;c:\users\daniel spiele\documents\visual studio 2010\projects\while-schleife\while-schleife\while-schleife.cpp(37): error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'endl'<br />
1&gt;c:\users\daniel spiele\documents\visual studio 2010\projects\while-schleife\while-schleife\while-schleife.cpp(37): warning C4551: Dem Funktionsaufruf fehlt die Argumentliste</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/293061/while-schleife</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 12:26:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/293061.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 Sep 2011 12:57:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to While-Schleife on Sat, 24 Sep 2011 13:00:44 GMT]]></title><description><![CDATA[<p>Hi Leute<br />
Ich bin noch ein C++-Neuling und lerne mit einem Buch. Leider funktioniert die While-Schleife nicht wie sie sollte aus einem Grund den ich nicht verstehe. Mit den Fehlern kann ich auch nicht viel anfangen.<br />
Hier der Code:</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

int main ()
{
	int Auswahl = 0;

	while (Auswahl != 3)
	{
		cout &lt;&lt;&quot;Menue:&quot;&lt;&lt;endl;
		cout &lt;&lt;&quot;------&quot;&lt;&lt;endl;
		cout &lt;&lt;&quot;1: Spiel starten&quot;&lt;&lt;endl;
		cout &lt;&lt;&quot;2: Optionen&quot;&lt;&lt;endl;
		cout &lt;&lt;&quot;3: Spiel beenden&quot;&lt;&lt;endl;

		cout &lt;&lt;&quot;Deine Wahl: &quot;&lt;&lt;endl;
		cin &gt;&gt; Auswahl;

		if (Auswahl == 1)
		{
        cout &lt;&lt;&quot;&gt; Das Spiel wird gestartet &lt;&quot;&lt;&lt;endl;
		}

		if (Auswahl == 2)
		{
        cout &lt;&lt;&quot;&gt; Optionen werden eingestellt &lt;&quot;&lt;&lt;endl;
		}

		if (Auswahl == 3)
		{
        cout &lt;&lt;&quot;&gt; Das Spiel wird beendet &lt;&quot;endl;
		}

		else
		{
        cout &lt;&lt;&quot;&gt; Falsche Eingabe &lt;&quot;endl;
		}

		cout &lt;&lt;&quot;\n\n\n&quot;&lt;&lt;endl;
	}
	return 0;
	system (&quot;pause&quot;);
</code></pre>
<p>}</p>
<p>Und hier ist der Fehler:<br />
1&gt;c:\users\daniel spiele\documents\visual studio 2010\projects\while-schleife\while-schleife\while-schleife.cpp(32): error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'endl'<br />
1&gt;c:\users\daniel spiele\documents\visual studio 2010\projects\while-schleife\while-schleife\while-schleife.cpp(32): warning C4551: Dem Funktionsaufruf fehlt die Argumentliste<br />
1&gt;c:\users\daniel spiele\documents\visual studio 2010\projects\while-schleife\while-schleife\while-schleife.cpp(37): error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'endl'<br />
1&gt;c:\users\daniel spiele\documents\visual studio 2010\projects\while-schleife\while-schleife\while-schleife.cpp(37): warning C4551: Dem Funktionsaufruf fehlt die Argumentliste</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2123235</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2123235</guid><dc:creator><![CDATA[Cybogg]]></dc:creator><pubDate>Sat, 24 Sep 2011 13:00:44 GMT</pubDate></item><item><title><![CDATA[Reply to While-Schleife on Sat, 24 Sep 2011 13:03:47 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">cout &lt;&lt;&quot;&gt; Das Spiel wird beendet &lt;&quot;endl;
                                        // ^-- &lt;&lt;-Operator fehlt
// ...
        cout &lt;&lt;&quot;&gt; Falsche Eingabe &lt;&quot;endl;
                                //  ^-- hier auch
</code></pre>
<p>Kleiner Tipp: Ein Leerzeichen zwischen den Token macht so etwas leichter sichtbar:</p>
<pre><code class="language-cpp">cout &lt;&lt; &quot;&gt; Das Spiel wird beendet &lt;&quot; &lt;&lt; endl;

// ...
        cout &lt;&lt; &quot;&gt; Falsche Eingabe &lt;&quot; &lt;&lt; endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2123239</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2123239</guid><dc:creator><![CDATA[seldon]]></dc:creator><pubDate>Sat, 24 Sep 2011 13:03:47 GMT</pubDate></item><item><title><![CDATA[Reply to While-Schleife on Sat, 24 Sep 2011 13:05:23 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>vergleiche mal die fehlerhafte Zeilen mit den anderen 'cout'-Zeilen.</p>
<p>Gerade beim &quot;&lt;&lt;&quot;-Operator ist es üblich, davor und danach ein Leerzeichen zu setzen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2123241</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2123241</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Sat, 24 Sep 2011 13:05:23 GMT</pubDate></item><item><title><![CDATA[Reply to While-Schleife on Sat, 24 Sep 2011 13:15:14 GMT]]></title><description><![CDATA[<p>Danke ich werde eure Tipps befolgen <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/2123244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2123244</guid><dc:creator><![CDATA[Cybogg]]></dc:creator><pubDate>Sat, 24 Sep 2011 13:15:14 GMT</pubDate></item><item><title><![CDATA[Reply to While-Schleife on Sat, 24 Sep 2011 17:09:41 GMT]]></title><description><![CDATA[<p>seldon schrieb:</p>
<blockquote>
<p>Kleiner Tipp: Ein Leerzeichen zwischen den Token macht so etwas leichter sichtbar</p>
</blockquote>
<p>Nein, im Gegenteil.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2123295</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2123295</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sat, 24 Sep 2011 17:09:41 GMT</pubDate></item><item><title><![CDATA[Reply to While-Schleife on Sat, 24 Sep 2011 17:37:35 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>seldon schrieb:</p>
<blockquote>
<p>Kleiner Tipp: Ein Leerzeichen zwischen den Token macht so etwas leichter sichtbar</p>
</blockquote>
<p>Nein, im Gegenteil.</p>
</blockquote>
<p>Doch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2123299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2123299</guid><dc:creator><![CDATA[ZwingendeArgumente]]></dc:creator><pubDate>Sat, 24 Sep 2011 17:37:35 GMT</pubDate></item><item><title><![CDATA[Reply to While-Schleife on Sat, 24 Sep 2011 17:43:02 GMT]]></title><description><![CDATA[<p>Wir sind hier doch nicht auf dem Golfplatz.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2123300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2123300</guid><dc:creator><![CDATA[Dobi]]></dc:creator><pubDate>Sat, 24 Sep 2011 17:43:02 GMT</pubDate></item><item><title><![CDATA[Reply to While-Schleife on Sat, 24 Sep 2011 19:38:27 GMT]]></title><description><![CDATA[<p>Ohne Leerzeichen... ist was für Freaks!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2123313</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2123313</guid><dc:creator><![CDATA[Nicht-Freak]]></dc:creator><pubDate>Sat, 24 Sep 2011 19:38:27 GMT</pubDate></item><item><title><![CDATA[Reply to While-Schleife on Mon, 26 Sep 2011 08:26:58 GMT]]></title><description><![CDATA[<p>außerdem wird beim jetzigen Programm jedes Mal (außer beim Beenden) &quot;&gt; Falsche Eingabe &lt;&quot; ausgegeben werden.</p>
<p>greetz KN4CK3R</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2123727</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2123727</guid><dc:creator><![CDATA[KN4CK3R]]></dc:creator><pubDate>Mon, 26 Sep 2011 08:26:58 GMT</pubDate></item><item><title><![CDATA[Reply to While-Schleife on Mon, 26 Sep 2011 12:25:41 GMT]]></title><description><![CDATA[<p>Die Eingabe könntest du auch mit einer <em>switch-case-Anweisung</em> abfangen, was hier vll. eher Sinn machen würde.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2123828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2123828</guid><dc:creator><![CDATA[arb3r]]></dc:creator><pubDate>Mon, 26 Sep 2011 12:25:41 GMT</pubDate></item></channel></rss>