<?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[Syntaxfehler &#x27;)&#x27;]]></title><description><![CDATA[<p>tag,</p>
<p>So ich habe wieder ein problem, diesmal geht es um ein problem bei einem projekt mit einem partner. Wir wollen ein quiz programmieren, welches bis dato noch in den kinderschuhen steckt:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

void fragestellen (std::string f, std::string a, std::string b, std::string c, std::string d, char y);

int main()
{
	int Anzahl = 0;
	cout &lt;&lt; &quot;Willkommen beim Quiz &quot;;
	cout &lt;&lt; &quot;Version 0.1a\n&quot;;
    cout &lt;&lt; &quot;es sind derzeitig &quot;&lt;&lt;Anzahl&lt;&lt;&quot; Fragen vorhanden.\n&quot;; 

	cout &lt;&lt; &quot;was wollen sie machen?\n&quot;;
	cout &lt;&lt; &quot;1=Quiz spielen,\n2=neue Fragen hinzufuegen,\n3=Beenden\n&quot;;

    cout &lt;&lt; endl;
	int menü;
	cin &gt;&gt; menü;
    if (menü == 1)
	    {
			fragestellen(&quot;was ergibt 3+4?&quot;,&quot;3&quot;,&quot;4&quot;,&quot;7&quot;,&quot;8&quot;,&quot;c&quot;,)
	    }
	else if (menü == 2)
	    {
	    }
	else if (menü == 3)
		{
	    cout &lt;&lt; endl;
		system(&quot;pause&quot;);
	    }
	else 
	    {
        cout &lt;&lt; &quot;Falsche Eingabe&quot;;
	    cin &gt;&gt; menü;
	    }

		return 0;
}

void fragestellen (std::string f, std::string a, std::string b, std::string c, std::string d, char y)
{
cout &lt;&lt; f &lt;&lt;endl;
cout &lt;&lt; endl;
cout &lt;&lt; a&lt;&lt;endl;
cout &lt;&lt; endl;
cout &lt;&lt; b&lt;&lt;endl;
cout &lt;&lt; endl;
cout &lt;&lt; c&lt;&lt;endl;
cout &lt;&lt; endl;
cout &lt;&lt; d&lt;&lt;endl;
cout &lt;&lt; endl;
char x;
cin &gt;&gt; x;
if (x == y)
{
	cout &lt;&lt; &quot;Richtig, 100 Punkte gehen auf dein Konto&quot;&lt;&lt;endl;
	cout &lt;&lt; &quot;Hier deine nächste Frage:&quot;&lt;&lt;endl;
    cout &lt;&lt; endl;
}
else 
{
	cout &lt;&lt; &quot;Leider falsch, &quot;&lt;&lt;y&lt;&lt;&quot; wäre richtig gewesen.&quot;&lt;&lt;endl;
	cout &lt;&lt; &quot;50 Punkte werden von deinem Konto abgezogen.&quot;&lt;&lt;endl;
	cout &lt;&lt; &quot;Hier deine nächste Frage:&quot;&lt;&lt;endl;
	cout &lt;&lt; endl;
}
}
</code></pre>
<p>Nun spukt der kompiler von visual studio 08 aber folgende warnmeldung aus:</p>
<pre><code>1&gt;Kompilieren...
1&gt;Quiz.cpp
1&gt;c:\users\christian\documents\visual studio 2008\projects\quiz\quiz\quiz.cpp(27) : error C2059: Syntaxfehler: ')'
</code></pre>
<p>Zuerst dachte ich &quot; oh ien syntaxfehler, lässt sich bestimmt leicht beheben&quot;, doch nach vielem rumprobieren hab ichs immer nch nicht geschafft...</p>
<p>edit: der syntaxfehler bezieht sich nicht auf zeile 27 sondern auf zeile 23</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/231027/syntaxfehler</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 21:48:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/231027.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Jan 2009 16:59:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Syntaxfehler &#x27;)&#x27; on Mon, 05 Jan 2009 17:01:17 GMT]]></title><description><![CDATA[<p>tag,</p>
<p>So ich habe wieder ein problem, diesmal geht es um ein problem bei einem projekt mit einem partner. Wir wollen ein quiz programmieren, welches bis dato noch in den kinderschuhen steckt:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

void fragestellen (std::string f, std::string a, std::string b, std::string c, std::string d, char y);

int main()
{
	int Anzahl = 0;
	cout &lt;&lt; &quot;Willkommen beim Quiz &quot;;
	cout &lt;&lt; &quot;Version 0.1a\n&quot;;
    cout &lt;&lt; &quot;es sind derzeitig &quot;&lt;&lt;Anzahl&lt;&lt;&quot; Fragen vorhanden.\n&quot;; 

	cout &lt;&lt; &quot;was wollen sie machen?\n&quot;;
	cout &lt;&lt; &quot;1=Quiz spielen,\n2=neue Fragen hinzufuegen,\n3=Beenden\n&quot;;

    cout &lt;&lt; endl;
	int menü;
	cin &gt;&gt; menü;
    if (menü == 1)
	    {
			fragestellen(&quot;was ergibt 3+4?&quot;,&quot;3&quot;,&quot;4&quot;,&quot;7&quot;,&quot;8&quot;,&quot;c&quot;,)
	    }
	else if (menü == 2)
	    {
	    }
	else if (menü == 3)
		{
	    cout &lt;&lt; endl;
		system(&quot;pause&quot;);
	    }
	else 
	    {
        cout &lt;&lt; &quot;Falsche Eingabe&quot;;
	    cin &gt;&gt; menü;
	    }

		return 0;
}

void fragestellen (std::string f, std::string a, std::string b, std::string c, std::string d, char y)
{
cout &lt;&lt; f &lt;&lt;endl;
cout &lt;&lt; endl;
cout &lt;&lt; a&lt;&lt;endl;
cout &lt;&lt; endl;
cout &lt;&lt; b&lt;&lt;endl;
cout &lt;&lt; endl;
cout &lt;&lt; c&lt;&lt;endl;
cout &lt;&lt; endl;
cout &lt;&lt; d&lt;&lt;endl;
cout &lt;&lt; endl;
char x;
cin &gt;&gt; x;
if (x == y)
{
	cout &lt;&lt; &quot;Richtig, 100 Punkte gehen auf dein Konto&quot;&lt;&lt;endl;
	cout &lt;&lt; &quot;Hier deine nächste Frage:&quot;&lt;&lt;endl;
    cout &lt;&lt; endl;
}
else 
{
	cout &lt;&lt; &quot;Leider falsch, &quot;&lt;&lt;y&lt;&lt;&quot; wäre richtig gewesen.&quot;&lt;&lt;endl;
	cout &lt;&lt; &quot;50 Punkte werden von deinem Konto abgezogen.&quot;&lt;&lt;endl;
	cout &lt;&lt; &quot;Hier deine nächste Frage:&quot;&lt;&lt;endl;
	cout &lt;&lt; endl;
}
}
</code></pre>
<p>Nun spukt der kompiler von visual studio 08 aber folgende warnmeldung aus:</p>
<pre><code>1&gt;Kompilieren...
1&gt;Quiz.cpp
1&gt;c:\users\christian\documents\visual studio 2008\projects\quiz\quiz\quiz.cpp(27) : error C2059: Syntaxfehler: ')'
</code></pre>
<p>Zuerst dachte ich &quot; oh ien syntaxfehler, lässt sich bestimmt leicht beheben&quot;, doch nach vielem rumprobieren hab ichs immer nch nicht geschafft...</p>
<p>edit: der syntaxfehler bezieht sich nicht auf zeile 27 sondern auf zeile 23</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1639967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1639967</guid><dc:creator><![CDATA[Fahrstuhlmusik]]></dc:creator><pubDate>Mon, 05 Jan 2009 17:01:17 GMT</pubDate></item><item><title><![CDATA[Reply to Syntaxfehler &#x27;)&#x27; on Mon, 05 Jan 2009 17:03:10 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">if (menü == 1)
        {
            fragestellen(&quot;was ergibt 3+4?&quot;,&quot;3&quot;,&quot;4&quot;,&quot;7&quot;,&quot;8&quot;,'c'); //; fehlte, char gehoert in '', nicht in &quot;&quot; und ein Komma zu viel
        }
</code></pre>
<p>Und es ist besser, keine Umlaute zu benutzen (menue anstatt menü).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1639968</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1639968</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Mon, 05 Jan 2009 17:03:10 GMT</pubDate></item><item><title><![CDATA[Reply to Syntaxfehler &#x27;)&#x27; on Mon, 05 Jan 2009 17:06:22 GMT]]></title><description><![CDATA[<p>hab ich schon versucht, syntaxfehler bleibt</p>
<p>edit: ok jetzt klappts^^ manchmal zweifel ich echt an mir selbst...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1639971</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1639971</guid><dc:creator><![CDATA[Fahrstuhlmusik]]></dc:creator><pubDate>Mon, 05 Jan 2009 17:06:22 GMT</pubDate></item><item><title><![CDATA[Reply to Syntaxfehler &#x27;)&#x27; on Wed, 07 Jan 2009 18:12:09 GMT]]></title><description><![CDATA[<p>will keinen neuen thread aufmachen, deswegen frage ich hier:</p>
<pre><code class="language-cpp">int main()
{
	zeigemenu();
	int menueingabe;
	cin&gt;&gt;menueingabe;

	while(menueingabe != '1','2','3')
	{
		cout&lt;&lt;endl;
		cout&lt;&lt;&quot;falsche Eingabe&quot;&lt;&lt;endl;
		cout&lt;&lt;endl;
		zeigemenu();
		cin &gt;&gt;menueingabe;
	}
</code></pre>
<p>wenn ich das programm jetzt starte, und 2 eingebe sagt es &quot;falsche Eingabe&quot;, ich hätte aber gerne das es erst&quot;falsche Eingabe&quot; ausgibt wenn ich was anderes als 1,2 oder 3 eingebe. Ich versteh nicht warum der das nicht so macht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1641287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1641287</guid><dc:creator><![CDATA[Fahrstuhlmusik]]></dc:creator><pubDate>Wed, 07 Jan 2009 18:12:09 GMT</pubDate></item><item><title><![CDATA[Reply to Syntaxfehler &#x27;)&#x27; on Wed, 07 Jan 2009 18:15:50 GMT]]></title><description><![CDATA[<p>Du suchst &amp;&amp; bzw ||</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1641291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1641291</guid><dc:creator><![CDATA[Shade Of Mine]]></dc:creator><pubDate>Wed, 07 Jan 2009 18:15:50 GMT</pubDate></item><item><title><![CDATA[Reply to Syntaxfehler &#x27;)&#x27; on Wed, 07 Jan 2009 18:19:04 GMT]]></title><description><![CDATA[<p>wenn du von cin in einen int einließt konvertiert er es dir in die Zahl 2<br />
'2' ist aber ein char und wird beim konvertierten in einen int in seinen ascii wert umgewandelt ( was um die 40)</p>
<p>versuch mal</p>
<pre><code class="language-cpp">while(menueeingabe &lt;1 || menueingabe &gt; 3)
</code></pre>
<p>das geht aber nur solange keine buchstaben eingegeben werden.</p>
<p>(text-&gt;zahl konvertierung google: atoi)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1641300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1641300</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Wed, 07 Jan 2009 18:19:04 GMT</pubDate></item><item><title><![CDATA[Reply to Syntaxfehler &#x27;)&#x27; on Wed, 07 Jan 2009 18:19:26 GMT]]></title><description><![CDATA[<p>vielleicht</p>
<pre><code class="language-cpp">while(menueingabe!='1' and menueingabe!='2' and menueingabe!='3')
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1641302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1641302</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Wed, 07 Jan 2009 18:19:26 GMT</pubDate></item><item><title><![CDATA[Reply to Syntaxfehler &#x27;)&#x27; on Wed, 07 Jan 2009 18:25:11 GMT]]></title><description><![CDATA[<p>siehe</p>
<pre><code class="language-cpp">int main()
{
	int zahl=0;
	cin&gt;&gt;zahl;
	cout&lt;&lt;zahl&lt;&lt;&quot;\n&quot;&lt;&lt;(int)'1'&lt;&lt;&quot;\n&quot;&lt;&lt;(zahl=='1')&lt;&lt;endl;
}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1641305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1641305</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Wed, 07 Jan 2009 18:25:11 GMT</pubDate></item><item><title><![CDATA[Reply to Syntaxfehler &#x27;)&#x27; on Thu, 08 Jan 2009 17:22:55 GMT]]></title><description><![CDATA[<p>dank euch, fencers lösung hat auf anhieb geklappt <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="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1641952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1641952</guid><dc:creator><![CDATA[Fahrstuhlmusik]]></dc:creator><pubDate>Thu, 08 Jan 2009 17:22:55 GMT</pubDate></item></channel></rss>