<?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[Dezimalzahl erkennen [c++ Konsolenanwendung]]]></title><description><![CDATA[<p>Hallo <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>
<p>Schon mal im Vor raus bin noch nicht sehr erfahren was C++ angeht. Außerdem hab ich google usw. schon benutzt, bin aber nicht fündig geworden!!!</p>
<p>Hier mein Problem und meine Frage:</p>
<p>Ich hab eine kleine Konsolenanwendung erstellt mit der man Addiern, Subtrahieren, Multiplizieren, Dividieren und asin ausrechnen kann...</p>
<blockquote>
<p>&gt; Alles läuft gut doch wenn ich eine Dezimalzahl eingebe erkennt die Konsole das nicht &lt;&lt;</p>
</blockquote>
<p>Außerdem wenn ich diesen Code kompiliere:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;math.h&quot;
const double PI = 3.1415926535897932384626433832795;
using namespace std;

	int add (int a, int b)
	{
		int c = a+b;
		return c;
	}
	int sub (int a, int b)
	{
		int c = a-b;
		return c;
	}
	int mul (int a, int b)
	{
		int c = a*b;
		return c;
	}
	int divi (int a, int b)
	{
		int c = a/b;
		return c;
	}
	int sinus (int a)
	{
		 double param, c;
		 param = a;
		 c = asin (param) * 180.0 / PI;
		 return c;
	}

int main()
{
	int ersteZahl;
	int zweiteZahl;
	int modus;

	cout &lt;&lt; &quot;       -----Willkommen beim Rechner von ******!----- &quot;;
	cout &lt;&lt; endl;

	cout &lt;&lt; &quot;        ~*Geben sie Ihren Modus ein*~ &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Addition: 1&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Subtraktion: 2 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Multiplikation: 3 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Division: 4 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Sinus[-&gt;Winkel]: 5 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;          Welchen Modus waehlen sie? &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot; &gt;&gt; &quot;;
	cin &gt;&gt; modus;

	cout &lt;&lt; &quot;Sie waehlten Modus &quot; &lt;&lt; &quot; &quot; &lt;&lt; modus &lt;&lt; &quot; . &quot; &lt;&lt; endl;

	cout &lt;&lt; endl;
	cout &lt;&lt; &quot; Geben Sie nun die erste Zahl ein: &quot;;
	cin &gt;&gt; ersteZahl;

	cout &lt;&lt; endl;
	cout &lt;&lt; &quot; Geben Sie die zweite Zahl ein (bei sinus egal): &quot;;
	cin &gt;&gt; zweiteZahl;

	if (modus == 1 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; + &quot; &lt;&lt;  &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; add(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 2 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; - &quot; &lt;&lt; &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; sub(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 3 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; * &quot; &lt;&lt; &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; mul(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 4 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; : &quot; &lt;&lt;  &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; divi(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 5 )
	{
		cout &lt;&lt; &quot; Der Sinus von &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; entspricht &quot; &lt;&lt;  &quot; &quot;;
		cout &lt;&lt; sinus(ersteZahl);
		cout &lt;&lt; &quot; Grad&quot; &lt;&lt; endl;
		cout &lt;&lt; endl;
		cout &lt;&lt; endl;
	}
	return 0;
}
</code></pre>
<p>Kommt folgende Fehlermeldung: <strong>1&gt;c:\users\</strong><em><strong>\documents\visual studio 2008\projects\*******\</strong></em>***<strong>.cpp(31) : warning C4244: 'return': Konvertierung von 'double' in 'int', möglicher Datenverlust</strong></p>
<p>(Ich weiß der code ist nicht ganz sauber ;))</p>
<p>Meine Frage an euch:<br />
Wie muss ich meinen code verändern damit meine Konsole die Dezimalzahlen erkennen kann? Und was muss ich tun damit der compiler mir keinen Warning mehr sendet?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/298566/dezimalzahl-erkennen-c-konsolenanwendung</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 18:54:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/298566.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Jan 2012 10:10:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 10:18:30 GMT]]></title><description><![CDATA[<p>Hallo <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>
<p>Schon mal im Vor raus bin noch nicht sehr erfahren was C++ angeht. Außerdem hab ich google usw. schon benutzt, bin aber nicht fündig geworden!!!</p>
<p>Hier mein Problem und meine Frage:</p>
<p>Ich hab eine kleine Konsolenanwendung erstellt mit der man Addiern, Subtrahieren, Multiplizieren, Dividieren und asin ausrechnen kann...</p>
<blockquote>
<p>&gt; Alles läuft gut doch wenn ich eine Dezimalzahl eingebe erkennt die Konsole das nicht &lt;&lt;</p>
</blockquote>
<p>Außerdem wenn ich diesen Code kompiliere:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;math.h&quot;
const double PI = 3.1415926535897932384626433832795;
using namespace std;

	int add (int a, int b)
	{
		int c = a+b;
		return c;
	}
	int sub (int a, int b)
	{
		int c = a-b;
		return c;
	}
	int mul (int a, int b)
	{
		int c = a*b;
		return c;
	}
	int divi (int a, int b)
	{
		int c = a/b;
		return c;
	}
	int sinus (int a)
	{
		 double param, c;
		 param = a;
		 c = asin (param) * 180.0 / PI;
		 return c;
	}

int main()
{
	int ersteZahl;
	int zweiteZahl;
	int modus;

	cout &lt;&lt; &quot;       -----Willkommen beim Rechner von ******!----- &quot;;
	cout &lt;&lt; endl;

	cout &lt;&lt; &quot;        ~*Geben sie Ihren Modus ein*~ &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Addition: 1&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Subtraktion: 2 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Multiplikation: 3 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Division: 4 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Sinus[-&gt;Winkel]: 5 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;          Welchen Modus waehlen sie? &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot; &gt;&gt; &quot;;
	cin &gt;&gt; modus;

	cout &lt;&lt; &quot;Sie waehlten Modus &quot; &lt;&lt; &quot; &quot; &lt;&lt; modus &lt;&lt; &quot; . &quot; &lt;&lt; endl;

	cout &lt;&lt; endl;
	cout &lt;&lt; &quot; Geben Sie nun die erste Zahl ein: &quot;;
	cin &gt;&gt; ersteZahl;

	cout &lt;&lt; endl;
	cout &lt;&lt; &quot; Geben Sie die zweite Zahl ein (bei sinus egal): &quot;;
	cin &gt;&gt; zweiteZahl;

	if (modus == 1 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; + &quot; &lt;&lt;  &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; add(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 2 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; - &quot; &lt;&lt; &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; sub(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 3 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; * &quot; &lt;&lt; &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; mul(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 4 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; : &quot; &lt;&lt;  &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; divi(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 5 )
	{
		cout &lt;&lt; &quot; Der Sinus von &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; entspricht &quot; &lt;&lt;  &quot; &quot;;
		cout &lt;&lt; sinus(ersteZahl);
		cout &lt;&lt; &quot; Grad&quot; &lt;&lt; endl;
		cout &lt;&lt; endl;
		cout &lt;&lt; endl;
	}
	return 0;
}
</code></pre>
<p>Kommt folgende Fehlermeldung: <strong>1&gt;c:\users\</strong><em><strong>\documents\visual studio 2008\projects\*******\</strong></em>***<strong>.cpp(31) : warning C4244: 'return': Konvertierung von 'double' in 'int', möglicher Datenverlust</strong></p>
<p>(Ich weiß der code ist nicht ganz sauber ;))</p>
<p>Meine Frage an euch:<br />
Wie muss ich meinen code verändern damit meine Konsole die Dezimalzahlen erkennen kann? Und was muss ich tun damit der compiler mir keinen Warning mehr sendet?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171343</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171343</guid><dc:creator><![CDATA[xGriimReapeeRx]]></dc:creator><pubDate>Mon, 23 Jan 2012 10:18:30 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 10:12:56 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">double sinus (int a) 
    { 
         double param, c; 
         param = a; 
         c = asin (param) * 180.0 / PI; 
         return c; 
    }
</code></pre>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171345</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171345</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Mon, 23 Jan 2012 10:12:56 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 10:17:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/16305">@Unskilled</a></p>
<p>Danke die Warnung ist weg aber trozdem erkennt die Konsole keine Dezimalzahlen wie z.B. 0.3 <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171347</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171347</guid><dc:creator><![CDATA[xGriimReapeeRx]]></dc:creator><pubDate>Mon, 23 Jan 2012 10:17:09 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 10:19:50 GMT]]></title><description><![CDATA[<p>Du liest aber Ganzzahlen ein. Daher funktioniert das nicht so wie erwartet.</p>
<p>edit: Missverständlich formuliert. So ist klarer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171350</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171350</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 23 Jan 2012 10:19:50 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 10:20:00 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/19375">@SeppJ</a></p>
<p>Okay und was muss ich am Code ändern damit sie Dezimalzahlen einliest ??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171352</guid><dc:creator><![CDATA[xGriimReapeeRx]]></dc:creator><pubDate>Mon, 23 Jan 2012 10:20:00 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 10:24:55 GMT]]></title><description><![CDATA[<p>Tipp:</p>
<p><strong>Integer</strong>: (englisch) Ganzzahl.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171354</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171354</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 23 Jan 2012 10:24:55 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 10:27:07 GMT]]></title><description><![CDATA[<p>Aha also double oder nicht <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="😉"
    /> habs probiert. Es erkennt die Dezimalzahl aber es kommen neue warnings... werde sie versuchen zu beheben. Ich editiere diese Antwort dann ob ichs geschafft hab oder nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171356</guid><dc:creator><![CDATA[xGriimReapeeRx]]></dc:creator><pubDate>Mon, 23 Jan 2012 10:27:07 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 10:29:00 GMT]]></title><description><![CDATA[<p>Die Warnungen kommen, weil der Rest des Programmes nicht zu den doubles im Hauptprogramm passt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171358</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171358</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 23 Jan 2012 10:29:00 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 10:38:19 GMT]]></title><description><![CDATA[<p>Ich gebs auf ich kriegs nicht auf die Reihe mit den Warning... Ich muss mir nochmal den Teil mit den Doubles ansehen <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>
<p>hier der aktuelle code:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;math.h&quot;
const double PI = 3.1415926535897932384626433832795;
using namespace std;

	int add (int a, int b)
	{
		int c = a+b;
		return c;
	}
	int sub (int a, int b)
	{
		int c = a-b;
		return c;
	}
	int mul (int a, int b)
	{
		int c = a*b;
		return c;
	}
	int divi (int a, int b)
	{
		int c = a/b;
		return c;
	}
	double sinus (int a)
    {
         double param, c;
         param = a;
         c = asin (param) * 180.0 / PI;
         return c;
    } 

int main()
{
	double ersteZahl;
	double zweiteZahl;
	int modus;

	cout &lt;&lt; &quot;       -----Willkommen beim Rechner von *****!----- &quot;;
	cout &lt;&lt; endl;

	cout &lt;&lt; &quot;        ~*Geben sie Ihren Modus ein*~ &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Addition: 1&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Subtraktion: 2 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Multiplikation: 3 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Division: 4 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;               Sinus [Winkel]: 5 &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;          Welchen Modus waehlen sie? &quot; &lt;&lt; endl;
	cout &lt;&lt; &quot; &gt;&gt; &quot;;
	cin &gt;&gt; modus;

	cout &lt;&lt; &quot;Sie waehlten Modus &quot; &lt;&lt; &quot; &quot; &lt;&lt; modus &lt;&lt; &quot; . &quot; &lt;&lt; endl;

	cout &lt;&lt; endl;
	cout &lt;&lt; &quot; Geben Sie nun die erste Zahl ein: &quot;;
	cin &gt;&gt; ersteZahl;

	cout &lt;&lt; endl;
	cout &lt;&lt; &quot; Geben Sie die zweite Zahl ein (bei sinus egal): &quot;;
	cin &gt;&gt; zweiteZahl;

	if (modus == 1 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; + &quot; &lt;&lt;  &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; add(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 2 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; - &quot; &lt;&lt; &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; sub(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 3 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; * &quot; &lt;&lt; &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; mul(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 4 )
	{
		cout &lt;&lt; &quot; &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; : &quot; &lt;&lt;  &quot; &quot; &lt;&lt; zweiteZahl &lt;&lt; &quot; = &quot;;
		cout &lt;&lt; divi(ersteZahl,zweiteZahl);
		cout &lt;&lt; endl;
	}
	else if (modus == 5 )
	{
		cout &lt;&lt; &quot; Der Sinus von &quot; &lt;&lt; ersteZahl &lt;&lt; &quot; entspricht &quot; &lt;&lt;  &quot; &quot;;
		cout &lt;&lt; sinus(ersteZahl);
		cout &lt;&lt; &quot; Grad&quot; &lt;&lt; endl;
		cout &lt;&lt; endl;
		cout &lt;&lt; endl;
	}
	return 0;
}
</code></pre>
<p>Warnings:</p>
<blockquote>
<p>(68) : warning C4244: 'Argument': Konvertierung von 'double' in 'int', möglicher Datenverlust<br />
(68) : warning C4244: 'Argument': Konvertierung von 'double' in 'int', möglicher Datenverlust<br />
(74) : warning C4244: 'Argument': Konvertierung von 'double' in 'int', möglicher Datenverlust<br />
(74) : warning C4244: 'Argument': Konvertierung von 'double' in 'int', möglicher Datenverlust<br />
(80) : warning C4244: 'Argument': Konvertierung von 'double' in 'int', möglicher Datenverlust<br />
(80) : warning C4244: 'Argument': Konvertierung von 'double' in 'int', möglicher Datenverlust<br />
(86) : warning C4244: 'Argument': Konvertierung von 'double' in 'int', möglicher Datenverlust<br />
(86) : warning C4244: 'Argument': Konvertierung von 'double' in 'int', möglicher Datenverlust<br />
(92) : warning C4244: 'Argument': Konvertierung von 'double' in 'int', möglicher Datenverlust</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2171364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171364</guid><dc:creator><![CDATA[xGriimReapeeRx]]></dc:creator><pubDate>Mon, 23 Jan 2012 10:38:19 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 10:50:21 GMT]]></title><description><![CDATA[<p>die Warnungen geben dir die Zeilennummern aus. In Zeile 68 passiert also eine solche Konvertierung.</p>
<pre><code class="language-cpp">cout &lt;&lt; add(ersteZahl,zweiteZahl);
</code></pre>
<p>Schau die doch mal die Typen von &quot;ersteZahl&quot; und &quot;zweiteZahl&quot; an. Welche Typen haben die Argumente von &quot;add&quot;?</p>
<p>Felix</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171370</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171370</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Mon, 23 Jan 2012 10:50:21 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 11:00:18 GMT]]></title><description><![CDATA[<p>und in welchem Typ erwartest du die Ergebnisse <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Versuche mal statt:</p>
<pre><code class="language-cpp">#include &quot;math.h&quot;
</code></pre>
<p>die C++ Version:</p>
<pre><code class="language-cpp">#include &lt;cmath&gt;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2171372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171372</guid><dc:creator><![CDATA[f.-th.]]></dc:creator><pubDate>Mon, 23 Jan 2012 11:00:18 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 11:04:10 GMT]]></title><description><![CDATA[<p>@Up Ja als Zahl also Dezimalzahl.</p>
<p>So keine Warnings mehr. Aber auch kein Ergebnis also Ergebnis = 0</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171373</guid><dc:creator><![CDATA[xGriimReapeeRx]]></dc:creator><pubDate>Mon, 23 Jan 2012 11:04:10 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 11:09:19 GMT]]></title><description><![CDATA[<p>xGriimReapeeRx schrieb:</p>
<blockquote>
<p>@Up Ja als Zahl also Dezimalzahl.</p>
</blockquote>
<p>Eben nicht.</p>
<blockquote>
<p>So keine Warnings mehr. Aber auch kein Ergebnis also Ergebnis = 0</p>
</blockquote>
<p>Ojeh, jetzt hast du irgendwas kaputt repariert, was vorher eigentlich schon fast richtig war.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171377</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171377</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 23 Jan 2012 11:09:19 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 18:48:53 GMT]]></title><description><![CDATA[<p>Guten Abend,</p>
<p>bei deinem Source-Code ist mir diese Zeile ins Auge gesprungen:</p>
<pre><code class="language-cpp">const double PI = 3.1415926535897932384626433832795;
</code></pre>
<p>Wenn ich Pi in einem Programm brauche, benutze ich meistens</p>
<pre><code class="language-cpp">M_PI;
</code></pre>
<p>Gibt dir 3.14159 aus (sollte meistens reichen).<br />
Nur nebenbei bemerkt : )<br />
Und die C++ Bib. benutzen: &lt;cmath&gt;</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171588</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171588</guid><dc:creator><![CDATA[Josh.Schr.]]></dc:creator><pubDate>Mon, 23 Jan 2012 18:48:53 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 18:53:38 GMT]]></title><description><![CDATA[<p>Klugscheiß: M_PI ist kein Standard-C++, sondern nur weit verbreitet. (Ich benutze es auch)</p>
<p>Wichtiger ist jedoch: Der Wert ist, wenn es existiert, natürlich schon so exakt wie ein double das hergibt, du hast dir bloß bei der Ausgabe nicht alle Stellen zeigen lassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171591</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171591</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 23 Jan 2012 18:53:38 GMT</pubDate></item><item><title><![CDATA[Reply to Dezimalzahl erkennen [c++ Konsolenanwendung] on Mon, 23 Jan 2012 19:02:28 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Klugscheiß: M_PI ist kein Standard-C++, sondern nur weit verbreitet. (Ich benutze es auch)</p>
</blockquote>
<p>okay, das wusste ich nicht. Mir wurde das so gelehrt.</p>
<pre><code class="language-cpp">Wichtiger ist jedoch: Der Wert ist, wenn es existiert, natürlich schon so exakt wie ein double das hergibt, du hast dir bloß bei der Ausgabe nicht alle Stellen zeigen lassen.
</code></pre>
<p>Jop, eindeutig Noob-Fehler. Danke für den Hinweis : )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2171595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2171595</guid><dc:creator><![CDATA[Josh.Schr.]]></dc:creator><pubDate>Mon, 23 Jan 2012 19:02:28 GMT</pubDate></item></channel></rss>