<?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[Falcher Wert berechnet]]></title><description><![CDATA[<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &lt;iostream&gt; 
#include &lt;math.h&gt;

using namespace std;

int nEingabe = 0, nHochZahl = 0, nHexFeld[3];

int main(void)
{
	for (int i = 3; i &gt;= 0; i--)
	{
		nHexFeld[i] = 0;
	}

	nEingabe = 65535;
	nHochZahl = pow((double)16, (int)3);
	nHexFeld[3] = nEingabe / nHochZahl;

	cout &lt;&lt; nEingabe &lt;&lt; &quot; &quot; &lt;&lt; nHexFeld[3];
	cout &lt;&lt; endl &lt;&lt; endl &lt;&lt; endl;

	system(&quot;PAUSE&quot;);
	return 0;
}
</code></pre>
<p>Das Problem ist, das der Variable nEingabe den Wert 15 zugewiesen wird und ich kann mir nicht erklären woher dieser Wert kommt. Wer eine Idee was ich falsch mache?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/257150/falcher-wert-berechnet</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 14:51:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/257150.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Dec 2009 19:08:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Falcher Wert berechnet on Wed, 23 Dec 2009 19:08:07 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &lt;iostream&gt; 
#include &lt;math.h&gt;

using namespace std;

int nEingabe = 0, nHochZahl = 0, nHexFeld[3];

int main(void)
{
	for (int i = 3; i &gt;= 0; i--)
	{
		nHexFeld[i] = 0;
	}

	nEingabe = 65535;
	nHochZahl = pow((double)16, (int)3);
	nHexFeld[3] = nEingabe / nHochZahl;

	cout &lt;&lt; nEingabe &lt;&lt; &quot; &quot; &lt;&lt; nHexFeld[3];
	cout &lt;&lt; endl &lt;&lt; endl &lt;&lt; endl;

	system(&quot;PAUSE&quot;);
	return 0;
}
</code></pre>
<p>Das Problem ist, das der Variable nEingabe den Wert 15 zugewiesen wird und ich kann mir nicht erklären woher dieser Wert kommt. Wer eine Idee was ich falsch mache?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1826968</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1826968</guid><dc:creator><![CDATA[Joachim1980]]></dc:creator><pubDate>Wed, 23 Dec 2009 19:08:07 GMT</pubDate></item><item><title><![CDATA[Reply to Falcher Wert berechnet on Wed, 23 Dec 2009 19:16:53 GMT]]></title><description><![CDATA[<p>Du hantierst mit nHexFeld[3] (also dem 4. Element), obwohl das Array nur drei Elemente hat.<br />
Und warum sind deine Variablen außerhalb von main deklariert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1826974</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1826974</guid><dc:creator><![CDATA[Athar]]></dc:creator><pubDate>Wed, 23 Dec 2009 19:16:53 GMT</pubDate></item><item><title><![CDATA[Reply to Falcher Wert berechnet on Wed, 23 Dec 2009 19:18:48 GMT]]></title><description><![CDATA[<p>Hehe... bin gerade dabei meine im Studium erworbenen Kenntnisse nicht vergammeln zu lassen. Ja da war etwas mit den Feldern....</p>
<p>Ich frage mich gerade auch, weshalb ich die Variablen als globale definiere. Schnell ändern!</p>
<p>Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1826976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1826976</guid><dc:creator><![CDATA[Joachim1980]]></dc:creator><pubDate>Wed, 23 Dec 2009 19:18:48 GMT</pubDate></item><item><title><![CDATA[Reply to Falcher Wert berechnet on Wed, 23 Dec 2009 19:24:51 GMT]]></title><description><![CDATA[<p>Wenn Du so ein Array füllst, würde ich die for Schleife von 0 bis n-1 laufen lassen, also hochinkrementieren. Das ist übersichtlich.</p>
<p>lg, freakC++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1826979</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1826979</guid><dc:creator><![CDATA[freakC++]]></dc:creator><pubDate>Wed, 23 Dec 2009 19:24:51 GMT</pubDate></item></channel></rss>