<?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[Buchstaben abfragen]]></title><description><![CDATA[<p><strong>Hi leutz, hier mein Problem:</strong></p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;

int main()
{
	char letter;

	cout&lt;&lt;&quot;-Addition von 2 Zahlen | a&quot;&lt;&lt;endl;
	cout&lt;&lt;&quot;-Subtraktion von 2 Zahlen | s&quot;&lt;&lt;endl;
	cout&lt;&lt;&quot;-Multiplikation von 2 Zahlen | m&quot;&lt;&lt;endl;
	cout&lt;&lt;&quot;-Division von 2 Zahlen | d&quot;&lt;&lt;endl;
	cin&gt;&gt;letter;
	cin.get();

	if(letter == a)
	{
		int zahl1, zahl2, ergebnis;
		cout&lt;&lt;&quot;Geben Sie die beiden Zahlen, durch ein Leerzeichen getrennt, ein: &quot;;
		cin&gt;&gt;zahl1;
		cin&gt;&gt;zahl2;
		ergebnis=zahl1+zahl2;
		cout&lt;&lt;&quot;Das Ergebnis lautet: &quot;&lt;&lt;ergebnis&lt;&lt;endl;
		cin.get();
	}
	else if(letter == s)
	{
		int zahl1, zahl2, ergebnis;
		cout&lt;&lt;&quot;Geben Sie die beiden Zahlen, durch ein Leerzeichen getrennt, ein: &quot;;
		cin&gt;&gt;zahl1;
		cin&gt;&gt;zahl2;
		ergebnis=zahl1-zahl2;
		cout&lt;&lt;&quot;Das Ergebnis lautet: &quot;&lt;&lt;ergebnis&lt;&lt;endl;
		cin.get();
	}
	else if(letter == m)
	{
		int zahl1, zahl2, ergebnis;
		cout&lt;&lt;&quot;Geben Sie die beiden Zahlen, durch ein Leerzeichen getrennt, ein: &quot;;
		cin&gt;&gt;zahl1;
		cin&gt;&gt;zahl2;
		ergebnis=zahl1*zahl2;
		cout&lt;&lt;&quot;Das Ergebnis lautet: &quot;&lt;&lt;ergebnis&lt;&lt;endl;
		cin.get();
	}
	else if(letter == d)
	{
		int zahl1, zahl2, ergebnis;
		cout&lt;&lt;&quot;Geben Sie die beiden Zahlen, durch ein Leerzeichen getrennt, ein: &quot;;
		cin&gt;&gt;zahl1;
		cin&gt;&gt;zahl2;
		ergebnis=zahl1/zahl2;
		cout&lt;&lt;&quot;Das Ergebnis lautet: &quot;&lt;&lt;ergebnis&lt;&lt;endl;
		cin.get();
	}

	cout&lt;&lt;&quot;Danke für Ihr Vertrauen!&quot;&lt;&lt;endl;
	cin.get();
}
</code></pre>
<p>Jetzt spuckt er mir diese Fehler aus:</p>
<pre><code>Fehler	1	error C2065: 'a': nichtdeklarierter Bezeichner	
Fehler	2	error C2065: 's': nichtdeklarierter Bezeichner		
Fehler	3	error C2065: 'm': nichtdeklarierter Bezeichner	
Fehler	4	error C2065: 'd': nichtdeklarierter Bezeichner
</code></pre>
<p>Was nu?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/227757/buchstaben-abfragen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 29 Sep 2026 19:22:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/227757.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 19 Nov 2008 16:34:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Buchstaben abfragen on Wed, 19 Nov 2008 16:34:54 GMT]]></title><description><![CDATA[<p><strong>Hi leutz, hier mein Problem:</strong></p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;

int main()
{
	char letter;

	cout&lt;&lt;&quot;-Addition von 2 Zahlen | a&quot;&lt;&lt;endl;
	cout&lt;&lt;&quot;-Subtraktion von 2 Zahlen | s&quot;&lt;&lt;endl;
	cout&lt;&lt;&quot;-Multiplikation von 2 Zahlen | m&quot;&lt;&lt;endl;
	cout&lt;&lt;&quot;-Division von 2 Zahlen | d&quot;&lt;&lt;endl;
	cin&gt;&gt;letter;
	cin.get();

	if(letter == a)
	{
		int zahl1, zahl2, ergebnis;
		cout&lt;&lt;&quot;Geben Sie die beiden Zahlen, durch ein Leerzeichen getrennt, ein: &quot;;
		cin&gt;&gt;zahl1;
		cin&gt;&gt;zahl2;
		ergebnis=zahl1+zahl2;
		cout&lt;&lt;&quot;Das Ergebnis lautet: &quot;&lt;&lt;ergebnis&lt;&lt;endl;
		cin.get();
	}
	else if(letter == s)
	{
		int zahl1, zahl2, ergebnis;
		cout&lt;&lt;&quot;Geben Sie die beiden Zahlen, durch ein Leerzeichen getrennt, ein: &quot;;
		cin&gt;&gt;zahl1;
		cin&gt;&gt;zahl2;
		ergebnis=zahl1-zahl2;
		cout&lt;&lt;&quot;Das Ergebnis lautet: &quot;&lt;&lt;ergebnis&lt;&lt;endl;
		cin.get();
	}
	else if(letter == m)
	{
		int zahl1, zahl2, ergebnis;
		cout&lt;&lt;&quot;Geben Sie die beiden Zahlen, durch ein Leerzeichen getrennt, ein: &quot;;
		cin&gt;&gt;zahl1;
		cin&gt;&gt;zahl2;
		ergebnis=zahl1*zahl2;
		cout&lt;&lt;&quot;Das Ergebnis lautet: &quot;&lt;&lt;ergebnis&lt;&lt;endl;
		cin.get();
	}
	else if(letter == d)
	{
		int zahl1, zahl2, ergebnis;
		cout&lt;&lt;&quot;Geben Sie die beiden Zahlen, durch ein Leerzeichen getrennt, ein: &quot;;
		cin&gt;&gt;zahl1;
		cin&gt;&gt;zahl2;
		ergebnis=zahl1/zahl2;
		cout&lt;&lt;&quot;Das Ergebnis lautet: &quot;&lt;&lt;ergebnis&lt;&lt;endl;
		cin.get();
	}

	cout&lt;&lt;&quot;Danke für Ihr Vertrauen!&quot;&lt;&lt;endl;
	cin.get();
}
</code></pre>
<p>Jetzt spuckt er mir diese Fehler aus:</p>
<pre><code>Fehler	1	error C2065: 'a': nichtdeklarierter Bezeichner	
Fehler	2	error C2065: 's': nichtdeklarierter Bezeichner		
Fehler	3	error C2065: 'm': nichtdeklarierter Bezeichner	
Fehler	4	error C2065: 'd': nichtdeklarierter Bezeichner
</code></pre>
<p>Was nu?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1617245</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1617245</guid><dc:creator><![CDATA[Xerses]]></dc:creator><pubDate>Wed, 19 Nov 2008 16:34:54 GMT</pubDate></item><item><title><![CDATA[Reply to Buchstaben abfragen on Wed, 19 Nov 2008 16:42:25 GMT]]></title><description><![CDATA[<p>Lern was Literale und was Variablen sind!<br />
<a href="http://de.wikipedia.org/wiki/Literal" rel="nofollow">http://de.wikipedia.org/wiki/Literal</a><br />
<a href="http://de.wikipedia.org/wiki/Variable_(Programmierung)" rel="nofollow">http://de.wikipedia.org/wiki/Variable_(Programmierung)</a></p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1617248</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1617248</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Wed, 19 Nov 2008 16:42:25 GMT</pubDate></item><item><title><![CDATA[Reply to Buchstaben abfragen on Wed, 19 Nov 2008 16:53:33 GMT]]></title><description><![CDATA[<pre><code>if(letter == &quot;a&quot;)
</code></pre>
<p>Switch-Case ist hierfür geeigneter, aber wenn es nur zum Üben ist.<br />
Ob man das cin.get() nach ein Eingabe und nach der Ausgabe schreiben muss ....</p>
<p>Diese ständigen Wiederholungen sind unschön, probiere es mal mit Switch-Case, wenn du denn schon so weit bist.</p>
<p>Formatierung: Leerzeichen sind auch übersichtlicher zwischen den Bezeichnern, Operanden und Operatoren. Gewöhne es dir an, bei langem Code wirst du es dir selber danken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1617255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1617255</guid><dc:creator><![CDATA[_Cache_]]></dc:creator><pubDate>Wed, 19 Nov 2008 16:53:33 GMT</pubDate></item><item><title><![CDATA[Reply to Buchstaben abfragen on Thu, 20 Nov 2008 04:54:40 GMT]]></title><description><![CDATA[<p><em>Cache</em> schrieb:</p>
<blockquote>
<pre><code>if(letter == &quot;a&quot;)
</code></pre>
</blockquote>
<p>Würde dann den nächsten Fehler geben, á la 'no match for operator== in letter == &quot;a&quot;' -&gt;</p>
<pre><code class="language-cpp">if (letter == 'a')
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1617452</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1617452</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 20 Nov 2008 04:54:40 GMT</pubDate></item><item><title><![CDATA[Reply to Buchstaben abfragen on Thu, 20 Nov 2008 12:30:19 GMT]]></title><description><![CDATA[<p>/eidt: doppelpost dank lag <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/1617453</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1617453</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 20 Nov 2008 12:30:19 GMT</pubDate></item><item><title><![CDATA[Reply to Buchstaben abfragen on Thu, 20 Nov 2008 07:01:51 GMT]]></title><description><![CDATA[<p>Bei der Division solltest du prüfen, ob zahl2!=0 ist, um eben eine Division durch 0 zu verhindern.</p>
<p>EDIT: Außerdem wäre es zumindest bei der Division ratsam, deine Variablen als Typ float oder double zu deklarieren (es sei denn, du willst tatsächlich eine Ganzzahlendivision durchführen, ich denke aber eher nicht).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1617466</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1617466</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 20 Nov 2008 07:01:51 GMT</pubDate></item></channel></rss>