<?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[[Anfänger] If Else einbindung]]></title><description><![CDATA[<p>Hey zusammen. Ich bin gerade dabei mir ein kleines Quiz zu schreiben. Funktioniert bisher wunderbar alles so wie ich es möchte. Nur ich habe eine Problem. Ich möchte das man während des Quiz durch eingabe von Beenden die Consolen anwendung schließen kann. Das Quiz ist in 4 Teile aufgeteilt die ich durch voids aufgeteilt habe. Jedes Quiz 1 Void. nach eingabe einer falschen antwort wird eine while schleife aufgelöst die dann zum starten eines neuen quit dient. Spirch eingabe 1-4 oder erneute abfrage. Bei eingabe von Beenden schliest sich das Programm. Nur ich möchte das man während der Fragen selbst auch Beenden kann. Dann seine Richtigen antworten bekommt und sich dann das Programm Beendet.</p>
<p>Hier 1 Void des Quiz sowie den rest der main.</p>
<p>Quiz</p>
<pre><code>void quiz() //Allgemeinwissen
{
	setlocale(LC_ALL, &quot;German&quot;);//Hiermit können umlaute in der Konsole wiedergegeben werden.
	string run;//String zum Starten des Programms
	int eingabe;//Variable für Antworten
	int rant = 0;//Anzahl der richtigen Antworten
	int differenz = 0;//Variable für die Zeitmessung
	time_t start = time(0);
	system(&quot;COLOR 6&quot;);

		cout &lt;&lt; &quot;\n&quot;;
		cout &lt;&lt; &quot;Frage 1: Was ist die größte Stadt Deutschlands?\n&quot;;
		cout &lt;&lt; &quot;1: Berlin\n&quot;;
		cout &lt;&lt; &quot;2: Hamburg\n&quot;;
		cout &lt;&lt; &quot;3: Köln\n&quot;;
		cout &lt;&lt; &quot;\n&quot;;
		cin &gt;&gt; eingabe;

		if (eingabe == 1)
		{
			cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
			rant++;

			cout &lt;&lt; &quot;\n&quot;;
			cout &lt;&lt; &quot;Frage 1: Wie lautet das Fremdwort für Festplatte?\n&quot;;
			cout &lt;&lt; &quot;1: USB\n&quot;;
			cout &lt;&lt; &quot;2: Harddrive\n&quot;;
			cout &lt;&lt; &quot;3: MIC\n&quot;;
			cout &lt;&lt; &quot;\n&quot;;
			cin &gt;&gt; eingabe;

			if (eingabe == 2)
			{
				cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
				rant++;

				cout &lt;&lt; &quot;\n&quot;;
				cout &lt;&lt; &quot;Frage 2: Wer erfand den Revolver?\n&quot;;
				cout &lt;&lt; &quot;1: Henry Ford\n&quot;;
				cout &lt;&lt; &quot;2: Albert Einstein\n&quot;;
				cout &lt;&lt; &quot;3: Samuel Colt\n&quot;;
				cout &lt;&lt; &quot;\n&quot;;
				cin &gt;&gt; eingabe;

				if (eingabe == 3)
				{
					cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
					rant++;

					cout &lt;&lt; &quot;\n&quot;;
					cout &lt;&lt; &quot;Frage 3: Was ist Roulette?\n&quot;;
					cout &lt;&lt; &quot;1: Ein Glücksspiel\n&quot;;
					cout &lt;&lt; &quot;2: Eine Automarke\n&quot;;
					cout &lt;&lt; &quot;3: Ein Tanzstyl\n&quot;;
					cout &lt;&lt; &quot;\n&quot;;
					cin &gt;&gt; eingabe;

					if (eingabe == 1)
					{
						cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
						rant++;

						cout &lt;&lt; &quot;\n&quot;;
						cout &lt;&lt; &quot;Frage 4: Wo lebten die Inkas?\n&quot;;
						cout &lt;&lt; &quot;1: Nigeria\n&quot;;
						cout &lt;&lt; &quot;2: Peru\n&quot;;
						cout &lt;&lt; &quot;3: Indien\n&quot;;
						cout &lt;&lt; &quot;\n&quot;;
						cin &gt;&gt; eingabe;

						if (eingabe == 2)
						{
							cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
							rant++;

							cout &lt;&lt; &quot;\n&quot;;
							cout &lt;&lt; &quot;Frage 5: Wann wurde die UNO gegründet?\n&quot;;
							cout &lt;&lt; &quot;1: 1935\n&quot;;
							cout &lt;&lt; &quot;2: 1950\n&quot;;
							cout &lt;&lt; &quot;3: 1945\n&quot;;
							cout &lt;&lt; &quot;\n&quot;;
							cin &gt;&gt; eingabe;

							if (eingabe == 3)
							{
								cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
								rant++;

								cout &lt;&lt; &quot;\n&quot;;
								cout &lt;&lt; &quot;Frage 6: Wie nennt man eine Reitsport Mannschaft?\n&quot;;
								cout &lt;&lt; &quot;1: Horde\n&quot;;
								cout &lt;&lt; &quot;2: Crew\n&quot;;
								cout &lt;&lt; &quot;3: Gilde\n&quot;;
								cout &lt;&lt; &quot;\n&quot;;
								cin &gt;&gt; eingabe;

								if (eingabe == 2)
								{
									cout &lt;&lt; &quot;Das ist Richtig!\n&quot;;
									rant++;

									cout &lt;&lt; &quot;\n&quot;;
									cout &lt;&lt; &quot;Das Quiz ist hier jetzt leider zuende.\nVielen dank das du es bis zu Ende durchgespielt hast\n&quot;;
									cout &lt;&lt; &quot;Um zu sehen wie viele Fragen du Richtig beantwortet hast\n&quot;;
									system(&quot;PAUSE&quot;);
									cout &lt;&lt; &quot;\n&quot;;
								}
							}
						}
					}
				}
			}
		}
		else
		cout &lt;&lt; &quot;Tut mir leid, Das war Falsch. Du hast &quot; &lt;&lt; rant &lt;&lt; &quot; Fragen Richtig beantwortet.\n&quot;;
		cout &lt;&lt; &quot;Um die Anwendung zu schließen 'Beenden' eingeben\n&quot;;
		time_t end = time(0);
		differenz = end - start;
		cout &lt;&lt; &quot;Du hast &quot; &lt;&lt; differenz &lt;&lt; &quot; Sekunden mit diesem Quiz verbracht\n&quot;;
}
</code></pre>
<p>Main</p>
<pre><code>int main()
{
	setlocale(LC_ALL, &quot;German&quot;);//Hiermit können umlaute in der Konsole wiedergegeben werden.
	string run;//String zum Starten des Programms
	cout &lt;&lt; &quot;Willkommen zu meinem kleinen Quiz.\nDu hast die möglichkeit zwischen folgenden Themen zu Wählen:\n&quot;;
	cout &lt;&lt; &quot;\n&quot;;
	cout &lt;&lt; &quot;1. Allgemeinwissen\n&quot;;
	cout &lt;&lt; &quot;2. Geschichte\n&quot;;
	cout &lt;&lt; &quot;3. Die Welt der Stars (Beinhaltet noch keine Fragen)\n&quot;;
	cout &lt;&lt; &quot;4. Kopfrechnen\n&quot;;
	cout &lt;&lt; &quot;\n&quot;;
	cout &lt;&lt; &quot;Wenn du das Quiz beenden willst gib einfach die 'Beenden' ein.\n&quot;;
	cout &lt;&lt; &quot;Zum Antworten einfach die Zahl der Antwort eingeben.\n&quot;;
	cout &lt;&lt; &quot;Alle Eingaben bitt mit der Taste 'Enter' bestätigen\n&quot;;
	cin &gt;&gt; run;

	if (run == &quot;Allgemeinwissen&quot; || run == &quot;1&quot;)
	{
		quiz();
	}
 else if (run == &quot;Geschichte&quot; || run == &quot;2&quot;)
 {
	 quiz2();
 }
 else if (run == &quot;Stars&quot; || run == &quot;3&quot;)
 {
	 quiz3();
 }
 else if (run == &quot;Kopfrechnen&quot; || run == &quot;4&quot;)
 {
	 quiz4();
 }
 //Nach Falscher Antwort
 while (1)
 {
	 cout &lt;&lt; &quot;1. Allgemeinwissen\n&quot;;
	 cout &lt;&lt; &quot;2. Geschichte\n&quot;;
	 cout &lt;&lt; &quot;3. Die Welt der Stars (Beinhaltet noch keine Fragen)\n&quot;;
	 cout &lt;&lt; &quot;4. Kopfrechnen\n&quot;;
	 cout &lt;&lt; &quot;\n&quot;;
	 cout &lt;&lt; &quot;Bitt wähle zwischen 1 und 4.\n&quot;;
	 cin &gt;&gt; run;

		 if (run == &quot;1&quot;)
		 {
			  quiz();
		 }
		 if (run == &quot;2&quot;)
		 {
			 quiz2();
		 }
		 if (run == &quot;3&quot;)
		 {
			 quiz3();
		 }
		 if (run == &quot;4&quot;)
		 {
			 quiz4();
		 }
		 if (run == &quot;Beenden&quot;)
		 {
			 return(0);
		 }
 }
	main();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/328175/anfänger-if-else-einbindung</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 17:18:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/328175.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 Sep 2014 09:36:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Anfänger] If Else einbindung on Fri, 26 Sep 2014 10:04:54 GMT]]></title><description><![CDATA[<p>Hey zusammen. Ich bin gerade dabei mir ein kleines Quiz zu schreiben. Funktioniert bisher wunderbar alles so wie ich es möchte. Nur ich habe eine Problem. Ich möchte das man während des Quiz durch eingabe von Beenden die Consolen anwendung schließen kann. Das Quiz ist in 4 Teile aufgeteilt die ich durch voids aufgeteilt habe. Jedes Quiz 1 Void. nach eingabe einer falschen antwort wird eine while schleife aufgelöst die dann zum starten eines neuen quit dient. Spirch eingabe 1-4 oder erneute abfrage. Bei eingabe von Beenden schliest sich das Programm. Nur ich möchte das man während der Fragen selbst auch Beenden kann. Dann seine Richtigen antworten bekommt und sich dann das Programm Beendet.</p>
<p>Hier 1 Void des Quiz sowie den rest der main.</p>
<p>Quiz</p>
<pre><code>void quiz() //Allgemeinwissen
{
	setlocale(LC_ALL, &quot;German&quot;);//Hiermit können umlaute in der Konsole wiedergegeben werden.
	string run;//String zum Starten des Programms
	int eingabe;//Variable für Antworten
	int rant = 0;//Anzahl der richtigen Antworten
	int differenz = 0;//Variable für die Zeitmessung
	time_t start = time(0);
	system(&quot;COLOR 6&quot;);

		cout &lt;&lt; &quot;\n&quot;;
		cout &lt;&lt; &quot;Frage 1: Was ist die größte Stadt Deutschlands?\n&quot;;
		cout &lt;&lt; &quot;1: Berlin\n&quot;;
		cout &lt;&lt; &quot;2: Hamburg\n&quot;;
		cout &lt;&lt; &quot;3: Köln\n&quot;;
		cout &lt;&lt; &quot;\n&quot;;
		cin &gt;&gt; eingabe;

		if (eingabe == 1)
		{
			cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
			rant++;

			cout &lt;&lt; &quot;\n&quot;;
			cout &lt;&lt; &quot;Frage 1: Wie lautet das Fremdwort für Festplatte?\n&quot;;
			cout &lt;&lt; &quot;1: USB\n&quot;;
			cout &lt;&lt; &quot;2: Harddrive\n&quot;;
			cout &lt;&lt; &quot;3: MIC\n&quot;;
			cout &lt;&lt; &quot;\n&quot;;
			cin &gt;&gt; eingabe;

			if (eingabe == 2)
			{
				cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
				rant++;

				cout &lt;&lt; &quot;\n&quot;;
				cout &lt;&lt; &quot;Frage 2: Wer erfand den Revolver?\n&quot;;
				cout &lt;&lt; &quot;1: Henry Ford\n&quot;;
				cout &lt;&lt; &quot;2: Albert Einstein\n&quot;;
				cout &lt;&lt; &quot;3: Samuel Colt\n&quot;;
				cout &lt;&lt; &quot;\n&quot;;
				cin &gt;&gt; eingabe;

				if (eingabe == 3)
				{
					cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
					rant++;

					cout &lt;&lt; &quot;\n&quot;;
					cout &lt;&lt; &quot;Frage 3: Was ist Roulette?\n&quot;;
					cout &lt;&lt; &quot;1: Ein Glücksspiel\n&quot;;
					cout &lt;&lt; &quot;2: Eine Automarke\n&quot;;
					cout &lt;&lt; &quot;3: Ein Tanzstyl\n&quot;;
					cout &lt;&lt; &quot;\n&quot;;
					cin &gt;&gt; eingabe;

					if (eingabe == 1)
					{
						cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
						rant++;

						cout &lt;&lt; &quot;\n&quot;;
						cout &lt;&lt; &quot;Frage 4: Wo lebten die Inkas?\n&quot;;
						cout &lt;&lt; &quot;1: Nigeria\n&quot;;
						cout &lt;&lt; &quot;2: Peru\n&quot;;
						cout &lt;&lt; &quot;3: Indien\n&quot;;
						cout &lt;&lt; &quot;\n&quot;;
						cin &gt;&gt; eingabe;

						if (eingabe == 2)
						{
							cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
							rant++;

							cout &lt;&lt; &quot;\n&quot;;
							cout &lt;&lt; &quot;Frage 5: Wann wurde die UNO gegründet?\n&quot;;
							cout &lt;&lt; &quot;1: 1935\n&quot;;
							cout &lt;&lt; &quot;2: 1950\n&quot;;
							cout &lt;&lt; &quot;3: 1945\n&quot;;
							cout &lt;&lt; &quot;\n&quot;;
							cin &gt;&gt; eingabe;

							if (eingabe == 3)
							{
								cout &lt;&lt; &quot;Das war Richtig!\n&quot;;
								rant++;

								cout &lt;&lt; &quot;\n&quot;;
								cout &lt;&lt; &quot;Frage 6: Wie nennt man eine Reitsport Mannschaft?\n&quot;;
								cout &lt;&lt; &quot;1: Horde\n&quot;;
								cout &lt;&lt; &quot;2: Crew\n&quot;;
								cout &lt;&lt; &quot;3: Gilde\n&quot;;
								cout &lt;&lt; &quot;\n&quot;;
								cin &gt;&gt; eingabe;

								if (eingabe == 2)
								{
									cout &lt;&lt; &quot;Das ist Richtig!\n&quot;;
									rant++;

									cout &lt;&lt; &quot;\n&quot;;
									cout &lt;&lt; &quot;Das Quiz ist hier jetzt leider zuende.\nVielen dank das du es bis zu Ende durchgespielt hast\n&quot;;
									cout &lt;&lt; &quot;Um zu sehen wie viele Fragen du Richtig beantwortet hast\n&quot;;
									system(&quot;PAUSE&quot;);
									cout &lt;&lt; &quot;\n&quot;;
								}
							}
						}
					}
				}
			}
		}
		else
		cout &lt;&lt; &quot;Tut mir leid, Das war Falsch. Du hast &quot; &lt;&lt; rant &lt;&lt; &quot; Fragen Richtig beantwortet.\n&quot;;
		cout &lt;&lt; &quot;Um die Anwendung zu schließen 'Beenden' eingeben\n&quot;;
		time_t end = time(0);
		differenz = end - start;
		cout &lt;&lt; &quot;Du hast &quot; &lt;&lt; differenz &lt;&lt; &quot; Sekunden mit diesem Quiz verbracht\n&quot;;
}
</code></pre>
<p>Main</p>
<pre><code>int main()
{
	setlocale(LC_ALL, &quot;German&quot;);//Hiermit können umlaute in der Konsole wiedergegeben werden.
	string run;//String zum Starten des Programms
	cout &lt;&lt; &quot;Willkommen zu meinem kleinen Quiz.\nDu hast die möglichkeit zwischen folgenden Themen zu Wählen:\n&quot;;
	cout &lt;&lt; &quot;\n&quot;;
	cout &lt;&lt; &quot;1. Allgemeinwissen\n&quot;;
	cout &lt;&lt; &quot;2. Geschichte\n&quot;;
	cout &lt;&lt; &quot;3. Die Welt der Stars (Beinhaltet noch keine Fragen)\n&quot;;
	cout &lt;&lt; &quot;4. Kopfrechnen\n&quot;;
	cout &lt;&lt; &quot;\n&quot;;
	cout &lt;&lt; &quot;Wenn du das Quiz beenden willst gib einfach die 'Beenden' ein.\n&quot;;
	cout &lt;&lt; &quot;Zum Antworten einfach die Zahl der Antwort eingeben.\n&quot;;
	cout &lt;&lt; &quot;Alle Eingaben bitt mit der Taste 'Enter' bestätigen\n&quot;;
	cin &gt;&gt; run;

	if (run == &quot;Allgemeinwissen&quot; || run == &quot;1&quot;)
	{
		quiz();
	}
 else if (run == &quot;Geschichte&quot; || run == &quot;2&quot;)
 {
	 quiz2();
 }
 else if (run == &quot;Stars&quot; || run == &quot;3&quot;)
 {
	 quiz3();
 }
 else if (run == &quot;Kopfrechnen&quot; || run == &quot;4&quot;)
 {
	 quiz4();
 }
 //Nach Falscher Antwort
 while (1)
 {
	 cout &lt;&lt; &quot;1. Allgemeinwissen\n&quot;;
	 cout &lt;&lt; &quot;2. Geschichte\n&quot;;
	 cout &lt;&lt; &quot;3. Die Welt der Stars (Beinhaltet noch keine Fragen)\n&quot;;
	 cout &lt;&lt; &quot;4. Kopfrechnen\n&quot;;
	 cout &lt;&lt; &quot;\n&quot;;
	 cout &lt;&lt; &quot;Bitt wähle zwischen 1 und 4.\n&quot;;
	 cin &gt;&gt; run;

		 if (run == &quot;1&quot;)
		 {
			  quiz();
		 }
		 if (run == &quot;2&quot;)
		 {
			 quiz2();
		 }
		 if (run == &quot;3&quot;)
		 {
			 quiz3();
		 }
		 if (run == &quot;4&quot;)
		 {
			 quiz4();
		 }
		 if (run == &quot;Beenden&quot;)
		 {
			 return(0);
		 }
 }
	main();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2419341</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2419341</guid><dc:creator><![CDATA[Homiophat]]></dc:creator><pubDate>Fri, 26 Sep 2014 10:04:54 GMT</pubDate></item><item><title><![CDATA[Reply to [Anfänger] If Else einbindung on Fri, 26 Sep 2014 10:05:35 GMT]]></title><description><![CDATA[<p>Du hast keine &quot;voids&quot;, sondern <em>Funktionen</em>. Funktionen können etwas zurück liefern (z.B. int, std::string, ...). Das sieht so aus:</p>
<pre><code class="language-cpp">int f()
{
  ...
  return 42;
}
</code></pre>
<p>Eine Funktion, die nichts liefert, verwendet void:</p>
<pre><code class="language-cpp">void f()
{
   ...
   return;
}
</code></pre>
<p>main darf im Programm <strong>niemals</strong> selbst aufgerufen werden.</p>
<p>Zu deinem genannten Problem:<br />
Du müsstest in deinen Funktionen &quot;Beenden&quot; erkennen, das Ergebnis ausgeben und dann entweder das Programm mit exit beenden oder die Funktionen ein entsprechendes Ergebnis zurück liefern lassen, auf das du dann reagierst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2419346</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2419346</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Fri, 26 Sep 2014 10:05:35 GMT</pubDate></item><item><title><![CDATA[Reply to [Anfänger] If Else einbindung on Fri, 26 Sep 2014 10:53:04 GMT]]></title><description><![CDATA[<p>Ganz verstehe ich das nicht.<br />
Um mal auf mein Code einzugehen. ich habe ja eine If abfrage. Dort wird die Antwort 1-3 abgefragt. Also entweder 1 2 oder 3. Bei Eingabe der richtigen Antwort wird die nächste frage ausgegeben. Bei Eingabe Einer Falschen Antwort kommt das else infrage welches dann die benötigte Zeit sowie die richtigen Antworten angibt. Danach tritt die while schleife inkraft wo abgefragt wird welche Kategoeir man als nächtes Spielen möchte. Wie genau kann ich jetzt sagen das wenn man anstatt 1-3 Beenden eingibt das Programm sich beendet. Wie könnte ich das aufbauen?</p>
<p>Und Entschuldigung für den falschen Ausdruck. Versuche mir das ganze grade mit Learning by doing beizubringen und ehrlich gesagt weis ich nicht genau wie das heißt was ich tue <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/2419351</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2419351</guid><dc:creator><![CDATA[Homiophat]]></dc:creator><pubDate>Fri, 26 Sep 2014 10:53:04 GMT</pubDate></item><item><title><![CDATA[Reply to [Anfänger] If Else einbindung on Fri, 26 Sep 2014 11:02:57 GMT]]></title><description><![CDATA[<p>Homiophat schrieb:</p>
<blockquote>
<p>Und Entschuldigung für den falschen Ausdruck.</p>
</blockquote>
<p>Es ist mir völlig egal, wie du dich ausdrückst. Dein Problem ist aber, dass du nicht wirklich verstanden hast, worum es geht.</p>
<p>Homiophat schrieb:</p>
<blockquote>
<p>Versuche mir das ganze grade mit Learning by doing beizubringen und ehrlich gesagt weis ich nicht genau wie das heißt was ich tue <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>
</blockquote>
<p>Eben. Besorge dir eine gutes Buch (Suchfunktion benutzen!), sonst wirst du scheitern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2419353</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2419353</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Fri, 26 Sep 2014 11:02:57 GMT</pubDate></item><item><title><![CDATA[Reply to [Anfänger] If Else einbindung on Fri, 26 Sep 2014 12:03:53 GMT]]></title><description><![CDATA[<p>Homiophat schrieb:</p>
<blockquote>
<p>Versuche mir das ganze grade mit Learning by doing beizubringen und ehrlich gesagt weis ich nicht genau wie das heißt was ich tue <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>
</blockquote>
<p>Bevor Du versuchst, Dir C++ beizubringen, versuche es doch erst mal mit der deutschen Rechtschreibung. Und wenn Du das so einigermassen drauf hast, dann fängst Du an, ein geeigneten C++-Buch durch zu arbeiten. Wenn Du dann noch Fragen hast, kannst Du prima diese beiden Sachen hier im Forum kombinieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2419371</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2419371</guid><dc:creator><![CDATA[besserwisser]]></dc:creator><pubDate>Fri, 26 Sep 2014 12:03:53 GMT</pubDate></item><item><title><![CDATA[Reply to [Anfänger] If Else einbindung on Fri, 10 Oct 2014 06:54:14 GMT]]></title><description><![CDATA[<pre><code>int main()
{

	char run;
	std::string eingabe;

	int differenz;
	time_t start = time(0);
	system(&quot;Color B4&quot;);

	std::cout &lt;&lt; &quot;*****EIN QUIZ*****\n&quot;;
	std::cout &lt;&lt; &quot;******************\n&quot;;
	std::cout &lt;&lt; &quot;Bitte Waehle ein Themengebiet\n&quot;;
	std::cout &lt;&lt; &quot;\n\n[1]Allgemeinwissen\n[2]Geschichte\n[3]NocheinThemengebiet\n[4]NocheinThemengebiet\n[E]Ende&quot;;
	std::cin &gt;&gt; run;

	switch (run)
	{
	case '1':QuizAllg(); break; 
	case '2':; break;
	case '3':; break;
	case '4':; break;
	case 'e':;
	case 'E':std::cout &lt;&lt;  &quot;Ende!!!! &quot;; break;
	}
	time_t end = time(0);
	differenz = end - start;
	std::cout &lt;&lt; &quot;Du hast &quot; &lt;&lt; differenz &lt;&lt; &quot;Sekunden mit dem Quiz verschwendet ;)\n&quot;;

	std::getchar();
	return 0;
}
</code></pre>
<pre><code>void QuizAllg()
{
	char wahl = 0;
	int punkte = 0;
	std::cout &lt;&lt; &quot;Frage 1: Was ist die größte Stadt Deutschlands?\n&quot;;
	std::cout &lt;&lt; &quot;1: Berlin\n&quot;;
	std::cout &lt;&lt; &quot;2: Hamburg\n&quot;;
	std::cout &lt;&lt; &quot;3: Köln\n&quot;;
	std::cout &lt;&lt; &quot;E: ENDE&quot;;
	std::cout &lt;&lt; &quot;\n&quot;;
	std::cin &gt;&gt; wahl;
	switch (wahl)
	{
	case '1': std::cout &lt;&lt; &quot;Richtig&quot;; punkte++; break;
	case '2': std::cout &lt;&lt; &quot;Falsch&quot;;; break;
	case '3': std::cout &lt;&lt; &quot;Falsch&quot;;; break;
	case 'E':
	case 'e': std::cout &lt;&lt; &quot;Ende und du hast &quot; &lt;&lt; punkte &lt;&lt; &quot; Punkte&quot;; break;
	default: std::cout &lt;&lt; &quot;Fehlerhafte Eingabe&quot;;
	}
	if (wahl != 'e' || wahl != 'E')
	{
		std::cout &lt;&lt; &quot;Frage 2: Frage 2: Wer erfand den Revolver?\n&quot;;
		std::cout &lt;&lt; &quot;1: Henry Ford\n&quot;;
		std::cout &lt;&lt; &quot;2: Albert Einstein\n&quot;;
		std::cout &lt;&lt; &quot;3: Samuel Colt\n&quot;;
		std::cout &lt;&lt; &quot;E: ENDE&quot;;
		std::cout &lt;&lt; &quot;\n&quot;;
		std::cin &gt;&gt; wahl;
		switch (wahl)
		{
		case '1': std::cout &lt;&lt; &quot;Falsch&quot;;; break;
		case '2': std::cout &lt;&lt; &quot;Falsch&quot;;; break;
		case '3': std::cout &lt;&lt; &quot;Richtig &quot;; punkte++; break;
		case 'E':
		case 'e': std::cout &lt;&lt; &quot;Ende und du hast &quot; &lt;&lt; punkte &lt;&lt; &quot; Punkte&quot;; break;
		default: std::cout &lt;&lt; &quot;Fehlerhafte Eingabe&quot;;
		}
	}
	if (wahl != 'e' || wahl != 'E')
	{
		std::cout &lt;&lt; &quot;Frage 3: Was ist Roulette?\n&quot;;
		std::cout &lt;&lt; &quot;1: Ein Glücksspiel\n&quot;;
		std::cout &lt;&lt; &quot;2: Eine Automarke\n&quot;;
		std::cout &lt;&lt; &quot;3: Ein Tanzstyl\n&quot;;
		std::cout &lt;&lt; &quot;E: ENDE&quot;;
		std::cout &lt;&lt; &quot;\n&quot;;
		std::cin &gt;&gt; wahl;
		switch (wahl)
		{
		case '1': std::cout &lt;&lt; &quot;Richtig &quot;; punkte++; break;
		case '2': std::cout &lt;&lt; &quot;Falsch&quot;;; break;
		case '3': std::cout &lt;&lt; &quot;Falsch&quot;;; break;
		case 'E':
		case 'e': std::cout &lt;&lt; &quot;Ende und du hast &quot; &lt;&lt; punkte &lt;&lt; &quot; Punkte&quot;; break;
		default: std::cout &lt;&lt; &quot;Fehlerhafte Eingabe&quot;;
		}
	}
	std::cout &lt;&lt; &quot; Ende und du hast &quot; &lt;&lt; punkte &lt;&lt; &quot; Punkte\n&quot;;
}
</code></pre>
<p>so wäre zumindest das mit dem beenden in einer beliebigen frage kein problem</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2421563</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2421563</guid><dc:creator><![CDATA[Zwoertsch]]></dc:creator><pubDate>Fri, 10 Oct 2014 06:54:14 GMT</pubDate></item></channel></rss>