<?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[Problem mit Muttertagsprogramm]]></title><description><![CDATA[<p>Hallo,<br />
ich lese schon des Öfteren seit meinem Studium Dinge über C++ in diesem Forum nach und finde die Qualität der Beiträge beachtlich, hab mich aber heute erst dazu entschlossen mich euch anzuschließen.<br />
Da ich nun ein Problem habe bei dem ich nicht weiter komme, wollte ich diese nette Community um hilfe bitten.<br />
Hier ist mein Quellcode für ein Muttertagsquiz auf Konsolenbasis:</p>
<pre><code class="language-cpp">#include &lt;cstdlib&gt;

#include &lt;cmath&gt;

#include &lt;iostream&gt;

using namespace std;

int main()

{

	int auswahl, taler=0;
	int a;

	/*

	Muttertagsquiz
	Mehrere Fragen werden für Mutter vorgelegt, die beantwortet werde müssen.
	Für jede richtige Antwort gibt steigt der Muttertags-Highscore

	*/

	cout &lt;&lt; &quot;–––===&gt;&gt;&gt;Muttertagsquiz&lt;&lt;&lt;===–––&quot; &lt;&lt; endl;

	cout &lt;&lt; &quot;CC Lizenz: sa&quot; &lt;&lt; endl;

	do												

	{

		cout &lt;&lt; &quot;Hallo liebe Mutter&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Um zu Wissen, ob dieser Tag eine Ehre für dich ist musst du uns ein paar Fragen beantworten.&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Die Fragen beziehen sich alle auf unsere Familie.&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Bitte befolge den Anweisungen:&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;-Alles wird klein geschrieben&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;-Ein Datum in folgender Form: ttmmjjjj (Bsp: 8. Mai 2011; Eingabe = 08052011&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;-Umlaute wie ä,ö,ü bitte als ae,oe,ue eingeben&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Sammle so viele Muttertagstaler wie möglich&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Deine Kinder wünschen dir viel Spaß&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Wenn du soweit bist, dann schreib: los &quot; ;

		cin &gt;&gt; auswahl ;

		if(auswahl == 0)

		{

		//Frage a		
		cout &lt;&lt; &quot;Erstmal eine leichte Frage zum Anfang: &quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;Wie heißt unsere Familie mit Nachnamen?&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;1 &lt;== M/021ller&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;2 &lt;-- Sch/201ller&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;3 &lt;== Kosch&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;4 &lt;-- Hess&quot; &lt;&lt; endl;

		cin &gt;&gt; a;

			if(a == 2)
			{			
			taler=taler+10;
			cout &lt;&lt; &quot;Richtig.&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Muttertaler:&quot; &lt;&lt; taler &lt;&lt; endl;
			}
			else(a != 2)
			{
			cout &lt;&lt; &quot;Zonk, leider falsch&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Richtige Antwort: 2&quot; &lt;&lt; endl;
			}

		//Frage b		
		cout &lt;&lt; &quot;Ich hoffe du hast Lust auf mehr bekommen :)&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;Wann wurde deine Tochter geboren?&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;1 &lt;== 21.09.1985&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;2 &lt;-- 20.07.1987&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;3 &lt;== 13.02.1989&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;4 &lt;-- 21.08.1983&quot; &lt;&lt; endl;

		cin &gt;&gt; a;

			if(a == 4)
			{			
			taler=taler+10;
			cout &lt;&lt; &quot;Richtig.&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Muttertaler:&quot; &lt;&lt; taler &lt;&lt; endl;
			}
			else(a != 4)
			{
			cout &lt;&lt; &quot;Zonk, leider falsch&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Richtige Antwort: 4&quot; &lt;&lt; endl;
			}

		//Frage c		
		cout &lt;&lt; &quot;Hihi, kamen dir die Zahlen irgendwie alle bekannt vor&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;Für welche Firma arbeitet dein ältester Sohn?&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;1 &lt;== BASF&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;2 &lt;-- Stadtwerke Schweinfurt&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;3 &lt;== Grundschule Poppenlauer&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;4 &lt;-- Lernt den ganzen Tag&quot; &lt;&lt; endl;

		cin &gt;&gt; a;

			if(a == 1)
			{			
			taler=taler+10;
			cout &lt;&lt; &quot;Richtig.&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Muttertaler:&quot; &lt;&lt; taler &lt;&lt; endl;
			}
			else(a != 1)
			{
			cout &lt;&lt; &quot;Zonk, leider falsch&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Richtige Antwort: 1&quot; &lt;&lt; endl;
			}

		//Frage d		
		cout &lt;&lt; &quot;Hmmm, bei diesen Antworten hat sich einer was gedacht&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;Wo studiert dien jüngster Sohn?&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;1 &lt;== Ludwigshafen&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;2 &lt;-- Gr/204fendorf&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;3 &lt;== Merseburg&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;4 &lt;-- Ma/341bach&quot; &lt;&lt; endl;

		cin &gt;&gt; a;

			if(a == 3)
			{			
			taler=taler+10;
			cout &lt;&lt; &quot;Richtig.&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Muttertaler:&quot; &lt;&lt; taler &lt;&lt; endl;
			}
			else(a != 3)
			{
			cout &lt;&lt; &quot;Zonk, leider falsch&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Richtige Antwort: 3&quot; &lt;&lt; endl;
			}

		}

		else if(auswahl != 0)

		{

		cout &lt;&lt; &quot;Falsch: Eingabe wiederholen, Anweisungen beachten :) &quot;;

		cin &gt;&gt; auswahl;

		}

	}

	while (auswahl == 1);				

	return EXIT_SUCCESS;					

}
</code></pre>
<p>Beim Komplimieren zeit er mir aber folgende Fehler an:<br />
muttertag.cpp: In function ‘int main()’:<br />
muttertag.cpp:60: error: expected ‘;’ before ‘{’ token<br />
muttertag.cpp:80: error: expected ‘;’ before ‘{’ token<br />
muttertag.cpp<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4af.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--hundred_points"
      title=":100:"
      alt="💯"
    /> error: expected ‘;’ before ‘{’ token<br />
muttertag.cpp:120: error: expected ‘;’ before ‘{’ token</p>
<p>Leider bin ich übelst der Anfänger und würde euch bitten mir zu helfen. Ich hab keine Ahnung wo der Fehler liegt, ist auch erst mein 3. Programm.</p>
<p>Vielen Dank schonmal im Vorraus<br />
MfG Andreas</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/286301/problem-mit-muttertagsprogramm</link><generator>RSS for Node</generator><lastBuildDate>Thu, 20 Aug 2026 23:10:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/286301.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 07 May 2011 12:17:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Muttertagsprogramm on Sat, 07 May 2011 12:17:42 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich lese schon des Öfteren seit meinem Studium Dinge über C++ in diesem Forum nach und finde die Qualität der Beiträge beachtlich, hab mich aber heute erst dazu entschlossen mich euch anzuschließen.<br />
Da ich nun ein Problem habe bei dem ich nicht weiter komme, wollte ich diese nette Community um hilfe bitten.<br />
Hier ist mein Quellcode für ein Muttertagsquiz auf Konsolenbasis:</p>
<pre><code class="language-cpp">#include &lt;cstdlib&gt;

#include &lt;cmath&gt;

#include &lt;iostream&gt;

using namespace std;

int main()

{

	int auswahl, taler=0;
	int a;

	/*

	Muttertagsquiz
	Mehrere Fragen werden für Mutter vorgelegt, die beantwortet werde müssen.
	Für jede richtige Antwort gibt steigt der Muttertags-Highscore

	*/

	cout &lt;&lt; &quot;–––===&gt;&gt;&gt;Muttertagsquiz&lt;&lt;&lt;===–––&quot; &lt;&lt; endl;

	cout &lt;&lt; &quot;CC Lizenz: sa&quot; &lt;&lt; endl;

	do												

	{

		cout &lt;&lt; &quot;Hallo liebe Mutter&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Um zu Wissen, ob dieser Tag eine Ehre für dich ist musst du uns ein paar Fragen beantworten.&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Die Fragen beziehen sich alle auf unsere Familie.&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Bitte befolge den Anweisungen:&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;-Alles wird klein geschrieben&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;-Ein Datum in folgender Form: ttmmjjjj (Bsp: 8. Mai 2011; Eingabe = 08052011&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;-Umlaute wie ä,ö,ü bitte als ae,oe,ue eingeben&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Sammle so viele Muttertagstaler wie möglich&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Deine Kinder wünschen dir viel Spaß&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;&quot; &lt;&lt; endl;

		cout &lt;&lt; &quot;Wenn du soweit bist, dann schreib: los &quot; ;

		cin &gt;&gt; auswahl ;

		if(auswahl == 0)

		{

		//Frage a		
		cout &lt;&lt; &quot;Erstmal eine leichte Frage zum Anfang: &quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;Wie heißt unsere Familie mit Nachnamen?&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;1 &lt;== M/021ller&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;2 &lt;-- Sch/201ller&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;3 &lt;== Kosch&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;4 &lt;-- Hess&quot; &lt;&lt; endl;

		cin &gt;&gt; a;

			if(a == 2)
			{			
			taler=taler+10;
			cout &lt;&lt; &quot;Richtig.&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Muttertaler:&quot; &lt;&lt; taler &lt;&lt; endl;
			}
			else(a != 2)
			{
			cout &lt;&lt; &quot;Zonk, leider falsch&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Richtige Antwort: 2&quot; &lt;&lt; endl;
			}

		//Frage b		
		cout &lt;&lt; &quot;Ich hoffe du hast Lust auf mehr bekommen :)&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;Wann wurde deine Tochter geboren?&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;1 &lt;== 21.09.1985&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;2 &lt;-- 20.07.1987&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;3 &lt;== 13.02.1989&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;4 &lt;-- 21.08.1983&quot; &lt;&lt; endl;

		cin &gt;&gt; a;

			if(a == 4)
			{			
			taler=taler+10;
			cout &lt;&lt; &quot;Richtig.&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Muttertaler:&quot; &lt;&lt; taler &lt;&lt; endl;
			}
			else(a != 4)
			{
			cout &lt;&lt; &quot;Zonk, leider falsch&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Richtige Antwort: 4&quot; &lt;&lt; endl;
			}

		//Frage c		
		cout &lt;&lt; &quot;Hihi, kamen dir die Zahlen irgendwie alle bekannt vor&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;Für welche Firma arbeitet dein ältester Sohn?&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;1 &lt;== BASF&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;2 &lt;-- Stadtwerke Schweinfurt&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;3 &lt;== Grundschule Poppenlauer&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;4 &lt;-- Lernt den ganzen Tag&quot; &lt;&lt; endl;

		cin &gt;&gt; a;

			if(a == 1)
			{			
			taler=taler+10;
			cout &lt;&lt; &quot;Richtig.&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Muttertaler:&quot; &lt;&lt; taler &lt;&lt; endl;
			}
			else(a != 1)
			{
			cout &lt;&lt; &quot;Zonk, leider falsch&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Richtige Antwort: 1&quot; &lt;&lt; endl;
			}

		//Frage d		
		cout &lt;&lt; &quot;Hmmm, bei diesen Antworten hat sich einer was gedacht&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;Wo studiert dien jüngster Sohn?&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;1 &lt;== Ludwigshafen&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;2 &lt;-- Gr/204fendorf&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;3 &lt;== Merseburg&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;4 &lt;-- Ma/341bach&quot; &lt;&lt; endl;

		cin &gt;&gt; a;

			if(a == 3)
			{			
			taler=taler+10;
			cout &lt;&lt; &quot;Richtig.&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Muttertaler:&quot; &lt;&lt; taler &lt;&lt; endl;
			}
			else(a != 3)
			{
			cout &lt;&lt; &quot;Zonk, leider falsch&quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;Richtige Antwort: 3&quot; &lt;&lt; endl;
			}

		}

		else if(auswahl != 0)

		{

		cout &lt;&lt; &quot;Falsch: Eingabe wiederholen, Anweisungen beachten :) &quot;;

		cin &gt;&gt; auswahl;

		}

	}

	while (auswahl == 1);				

	return EXIT_SUCCESS;					

}
</code></pre>
<p>Beim Komplimieren zeit er mir aber folgende Fehler an:<br />
muttertag.cpp: In function ‘int main()’:<br />
muttertag.cpp:60: error: expected ‘;’ before ‘{’ token<br />
muttertag.cpp:80: error: expected ‘;’ before ‘{’ token<br />
muttertag.cpp<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4af.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--hundred_points"
      title=":100:"
      alt="💯"
    /> error: expected ‘;’ before ‘{’ token<br />
muttertag.cpp:120: error: expected ‘;’ before ‘{’ token</p>
<p>Leider bin ich übelst der Anfänger und würde euch bitten mir zu helfen. Ich hab keine Ahnung wo der Fehler liegt, ist auch erst mein 3. Programm.</p>
<p>Vielen Dank schonmal im Vorraus<br />
MfG Andreas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2060010</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2060010</guid><dc:creator><![CDATA[kampfdackel]]></dc:creator><pubDate>Sat, 07 May 2011 12:17:42 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Muttertagsprogramm on Sat, 07 May 2011 12:25:29 GMT]]></title><description><![CDATA[<p>Es muss <code>else if (a != 2)</code> heißen, nicht <code>else (a != 2)</code> . Alternativ kannst du auch einfach <code>else</code> schreiben und die Bedingung weglassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2060012</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2060012</guid><dc:creator><![CDATA[Irgendwer]]></dc:creator><pubDate>Sat, 07 May 2011 12:25:29 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Muttertagsprogramm on Sat, 07 May 2011 12:28:44 GMT]]></title><description><![CDATA[<p>Die Zeilennummern stimmen aber nicht mit deinem Original-Quellcode überein, oder?</p>
<p>Der Compiler sagt dir in der Regel ziemlich genau, was und wo falsch ist. Du solltest dich mit seinen Meldungen beschäftigen.</p>
<p>Im vorliegenden Fall hätte dir das aber wahrscheinlich erstmal nicht viel geholfen. Du hast in den else-Zweigen jeweils ein if vergessen. Das else kann nur alternative Anweisungen angeben, keine Bedingungen prüfen. Wenn du weitere Bedingungen prüfen willst, musst du auch eine weitere if-Abfrage schreiben.</p>
<p>Korrekt muss es also heißen:</p>
<pre><code class="language-cpp">...
if
{
} else if {}
...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2060014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2060014</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 07 May 2011 12:28:44 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Muttertagsprogramm on Sat, 07 May 2011 12:39:31 GMT]]></title><description><![CDATA[<p>woaaaaa, vielen vielen dank, es hat funktioniert. hab gedacht else ist das selbe wie else if.</p>
<p>vielen vielen dank für die schnellen antworten.<br />
jetzt steht meinem muttertagsgeschenk nichts mehr im wege</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2060016</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2060016</guid><dc:creator><![CDATA[kampfdackel]]></dc:creator><pubDate>Sat, 07 May 2011 12:39:31 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Muttertagsprogramm on Sat, 07 May 2011 12:46:13 GMT]]></title><description><![CDATA[<p>kampfdackel schrieb:</p>
<blockquote>
<p>woaaaaa, vielen vielen dank, es hat funktioniert. hab gedacht else ist das selbe wie else if.</p>
</blockquote>
<p>Das liegt wahrscheinlich daran, dass &quot;else if&quot; wie eine einzige Anweisung aussieht. Ich habe das auch erst im dritten Buch verstanden, mit dem ich gearbeitet habe (bin selbst noch blutiger Anfänger und tu' mich sehr schwer), weil es da mal vernünftig erklärt war.</p>
<p>Das eigentliche if-Konstrukt sieht so aus:</p>
<pre><code class="language-cpp">if
    // Anweisung
else
    // Anweisung
</code></pre>
<p>Wobei der else-Zweig optional ist. Die beiden Zweige nehmen nur genau <em>eine</em> Anweisung, weshalb, wenn du mehrere Dinge ausführen willst, diese in einen Block zusammengefasst werden müssen:</p>
<pre><code class="language-cpp">if ( /* Bedingung */ ){
    // Anweisung
    // noch eine
    // usw.
} else {
    // alternative Anweisung
    // noch eine
    // usw.
}
</code></pre>
<p>Da eine if-Abfrage auch nur eine Anweisung ist, kannst du die natürlich schachteln, um mehrere Alternativen zu prüfen:</p>
<pre><code class="language-cpp">if ( /* Bedingung */ ) {
    // Anweisungen
} else if ( /* Bedingung */ ) {
    // Anweisungen
}
</code></pre>
<p>Die Anweisung(en) des else-Zweig sind hier praktisch eine neue if-Abfrage. Usw.</p>
<p>kampfdackel schrieb:</p>
<blockquote>
<p>also könnte ich theoretisch die bedingung weglassen und mit else würde es, außer wenn es richtig ist immer die else verzweigung anzeigen?</p>
</blockquote>
<p>Richtig. Wenn du nur zwei Alternativen hast, also &quot;wenn x, dann y, sonst z&quot;, musst du im else-Zweig auch keine Bedingung mehr prüfen, das tust du ja schon im if-Zweig.</p>
<p>kampfdackel schrieb:</p>
<blockquote>
<p>eine frage hätte ich auch noch. wenn ich eine variable mit einer string eingabe überprüfen will, würder der befehl wie folgt aussehen?</p>
<pre><code class="language-cpp">if(variable == 'eingabe')
else ... //bei falscher antwort?
</code></pre>
</blockquote>
<p>Strings werden in doppelte Anführungszeichen gefasst, nicht in Hochkommata. Aber String-Vergleiche mit &quot;==&quot; sind imho nicht so günstig. Da gibt es bessere Alternativen, aber so weit bin ich selbst noch lange nicht. <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/2060018</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2060018</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 07 May 2011 12:46:13 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Muttertagsprogramm on Sat, 07 May 2011 12:54:24 GMT]]></title><description><![CDATA[<p>wie musst ich die Variable initialisieren, wenn ich sie mit einem String vergleichen will? Würde int a, taler reichen?</p>
<pre><code class="language-cpp">int a, taler;

if(a == &quot;antwort&quot;)
{ cout &lt;&lt; &quot;Richtig&quot; &lt;&lt; endl;
taler=taler+10;
}
else { cout &lt;&lt; &quot;Falsch&quot; &lt;&lt; endl;}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2060019</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2060019</guid><dc:creator><![CDATA[kampfdackel]]></dc:creator><pubDate>Sat, 07 May 2011 12:54:24 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Muttertagsprogramm on Sat, 07 May 2011 13:01:30 GMT]]></title><description><![CDATA[<p>Nein, dann muss die Variable selbst natürlich auch den Datentyp string haben.</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
#include&lt;string&gt;

int main() {
    std::string a = &quot;&quot;;
}
</code></pre>
<p>(oder: )</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
#include&lt;string&gt;
using namespace std;

int main() {
    string a = &quot;&quot;;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2060023</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2060023</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 07 May 2011 13:01:30 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Muttertagsprogramm on Sat, 07 May 2011 14:54:39 GMT]]></title><description><![CDATA[<p>also ich würde mich über so ein geschenk freuen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2060049</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2060049</guid><dc:creator><![CDATA[jetztmama]]></dc:creator><pubDate>Sat, 07 May 2011 14:54:39 GMT</pubDate></item></channel></rss>