<?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[Versteh das nicht!!!]]></title><description><![CDATA[<p>Hier die berechnung stimmt nich, es kommt &quot;540&quot; statt &quot;33&quot; raus.. wieso??</p>
<pre><code class="language-cpp">#define XTFREQ          7372800         //On-board Crystal frequency
#define PLLMODE         16             	//On-chip PLL setting
#define FCY             XTFREQ*PLLMODE/4        //Instruction Cycle Frequency
#define CYC		1000000000/FCY

double ergebnis= CYC;
</code></pre>
<p>kann mir das jemand erkären?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/211470/versteh-das-nicht</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 07:21:35 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/211470.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Apr 2008 15:26:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Versteh das nicht!!! on Wed, 23 Apr 2008 15:26:33 GMT]]></title><description><![CDATA[<p>Hier die berechnung stimmt nich, es kommt &quot;540&quot; statt &quot;33&quot; raus.. wieso??</p>
<pre><code class="language-cpp">#define XTFREQ          7372800         //On-board Crystal frequency
#define PLLMODE         16             	//On-chip PLL setting
#define FCY             XTFREQ*PLLMODE/4        //Instruction Cycle Frequency
#define CYC		1000000000/FCY

double ergebnis= CYC;
</code></pre>
<p>kann mir das jemand erkären?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1496987</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1496987</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Wed, 23 Apr 2008 15:26:33 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Wed, 23 Apr 2008 15:29:39 GMT]]></title><description><![CDATA[<p>Und wie kommst Du auf 33? <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>
<pre><code>1000000000 / 7372800 * 16 / 4 = ?
</code></pre>
<p>Tipp: Klammersetzung und so <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/1496991</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1496991</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Wed, 23 Apr 2008 15:29:39 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Wed, 23 Apr 2008 15:34:12 GMT]]></title><description><![CDATA[<p>Immer das gleiche Problem. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<pre><code class="language-cpp">define quad(x) x*x
</code></pre>
<p>:p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1496994</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1496994</guid><dc:creator><![CDATA[*D*]]></dc:creator><pubDate>Wed, 23 Apr 2008 15:34:12 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Wed, 23 Apr 2008 16:39:47 GMT]]></title><description><![CDATA[<p>Ganz von den anderen Kommentaren abgesehen werden deine defines wohl zudem als Integer interpretiert (0.0 =&gt; double, 0 =&gt; int) und du hast daher eine Ganzzahlrechnung.</p>
<p>Da du auch mit speziellen Geräten arbeitest, würde mich mal der Wertebereich des int auf dieser Plattform interessieren</p>
<p>cu André</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1497029</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497029</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Wed, 23 Apr 2008 16:39:47 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Wed, 23 Apr 2008 16:59:59 GMT]]></title><description><![CDATA[<p>Wenn ich das so:</p>
<pre><code class="language-cpp">#define CYC    1000000000/(FCY)
</code></pre>
<p>schreibe, gehts. <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>Genau den gleichen Streit habe ich auch immer mit meinem Taschenrechner.. <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/1497043</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497043</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Wed, 23 Apr 2008 16:59:59 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Wed, 23 Apr 2008 17:45:41 GMT]]></title><description><![CDATA[<p>Um das Prinzip verständlicher zu machen:<br />
Die Präprozessor-Direktive #define führt lediglich eine Textersetzung durch.<br />
Wenn du also schreibst:</p>
<pre><code class="language-cpp">#define FCY             XTFREQ*PLLMODE/4
</code></pre>
<p>, dann setzt der Compiler für FCY an den Zielcode auch nur das ein, und setzt nicht automatisch Klammern.</p>
<pre><code class="language-cpp">#define CYC        1000000000/FCY   // so hast du CYC definiert

// CYC hat den Wert 
1000000000/XTFREQ*PLLMODE/4    // keine Klammern!
</code></pre>
<p>Ich bin mir allerdings nicht ganz sicher, eventuell wird für CYC auch der bereits ausgerechnete Wert eingesetzt. In diesem Falle wird an der bereits erwähnten Integer-Division liegen, die du aber sowieso beseitigen musst, wenn du genaue Werte willst.</p>
<p>Noch was: Treffende Titel sind sehr nützlich; viele Leute, die hier posten haben wohl etwas, das sie nicht verstehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1497066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497066</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 23 Apr 2008 17:45:41 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Wed, 23 Apr 2008 17:48:26 GMT]]></title><description><![CDATA[<p>Du solltst Dich vielleicht einfach von den Defines (wieso Defines?!?!) trennen und Konstanten verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1497067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497067</guid><dc:creator><![CDATA[Konrad Rudolph]]></dc:creator><pubDate>Wed, 23 Apr 2008 17:48:26 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Fri, 25 Apr 2008 11:51:44 GMT]]></title><description><![CDATA[<p>das problem ist das er prüfen soll ob wirklich ein richtiges rechenzeichen eingegeben wird wenn er ein falsches erkennt soll er so lange abfragen bis er ein richtiges bekommt und dann die rechnung ausgeben. das funktioniert aber er geht dann in eine endlos schleife guckt mal vielleicht erkennt ihr das problem.<br />
oder sagt mir vielleicht auch wie man das ganz anders schreiben könnte.</p>
<p>//---------------------------------------------------------------------------</p>
<p>#pragma hdrstop<br />
#include &lt;iostream.h&gt;<br />
//---------------------------------------------------------------------------</p>
<p>#pragma argsused<br />
int main()<br />
{</p>
<p>double zahl1, zahl2, ergebnis;<br />
char coperator, auswahl='j';</p>
<p>while (auswahl=='j' || auswahl=='J')<br />
{</p>
<p>cout&lt;&lt;&quot;--------Taschenrechner-------\n&quot;;<br />
cout&lt;&lt;&quot;-----------------------------\n&quot;;</p>
<p>cout&lt;&lt;&quot;zahl eingeben \n&quot;;<br />
cin&gt;&gt;zahl1;</p>
<p>cout&lt;&lt;&quot;operator eingeben \n&quot;;<br />
cin&gt;&gt;coperator;</p>
<p>cout&lt;&lt;&quot;zahl eingeben \n&quot;;<br />
cin&gt;&gt;zahl2;</p>
<p>//--Vergleich der Operatoren mit Rechnung---------<br />
while (coperator !='/' || coperator != '*' || coperator != '+'||coperator !='-')<br />
{</p>
<p>switch(coperator)<br />
{</p>
<p>case '<em>': ergebnis=zahl1</em>zahl2; cout&lt;&lt;zahl1&lt;&lt;&quot; &quot;&lt;&lt;coperator&lt;&lt;&quot; &quot;&lt;&lt;zahl2&lt;&lt;&quot; = &quot; &lt;&lt; ergebnis&lt;&lt;endl&lt;&lt;endl;</p>
<p>break;</p>
<p>case '/': ergebnis=zahl1/zahl2; cout&lt;&lt;zahl1&lt;&lt;&quot; &quot;&lt;&lt;coperator&lt;&lt;&quot; &quot;&lt;&lt;zahl2&lt;&lt;&quot; = &quot; &lt;&lt; ergebnis&lt;&lt;endl&lt;&lt;endl;</p>
<p>break;</p>
<p>case '+': ergebnis=zahl1+zahl2; cout&lt;&lt;zahl1&lt;&lt;&quot; &quot;&lt;&lt;coperator&lt;&lt;&quot; &quot;&lt;&lt;zahl2&lt;&lt;&quot; = &quot; &lt;&lt; ergebnis&lt;&lt;endl&lt;&lt;endl;</p>
<p>break;</p>
<p>case '-': ergebnis=zahl1-zahl2; cout&lt;&lt;zahl1&lt;&lt;&quot; &quot;&lt;&lt;coperator&lt;&lt;&quot; &quot;&lt;&lt;zahl2&lt;&lt;&quot; = &quot; &lt;&lt; ergebnis&lt;&lt;endl&lt;&lt;endl;</p>
<p>break;</p>
<p>default: cout&lt;&lt;&quot;neues rechenzeichen eingeben\n&quot;;cin&gt;&gt;coperator;</p>
<p>}<br />
}<br />
cout&lt;&lt;&quot;nochmal&quot;;<br />
cin&gt;&gt;auswahl;</p>
<p>system (&quot;Pause&quot;);<br />
}</p>
<p>getchar();<br />
return 0;<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1498044</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1498044</guid><dc:creator><![CDATA[programmnoob]]></dc:creator><pubDate>Fri, 25 Apr 2008 11:51:44 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Fri, 25 Apr 2008 12:06:48 GMT]]></title><description><![CDATA[<p>programmnoob schrieb:</p>
<blockquote>
<p>das problem ist das er prüfen soll ob wirklich ein richtiges rechenzeichen eingegeben wird</p>
</blockquote>
<p>Nein, das Problem ist Klammersetzung. Wenn Du ein eigenes Problem haben möchtest, mach doch bitte Deinen eigenen Thread auf, danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1498049</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1498049</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Fri, 25 Apr 2008 12:06:48 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Fri, 25 Apr 2008 12:43:53 GMT]]></title><description><![CDATA[<p>weiß nicht selbst wenn es klammer setzung ist wisst ihr wie das geht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1498066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1498066</guid><dc:creator><![CDATA[programmnoob]]></dc:creator><pubDate>Fri, 25 Apr 2008 12:43:53 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Fri, 25 Apr 2008 12:51:14 GMT]]></title><description><![CDATA[<p>Was er Dir sagen wollte, war, das Deine Frage nichts mit dem Thema dieses Threads (Klammersetzung) zu tun hat und Du gefälligst einen eigenen Thread aufmachen sollst.<br />
Und benutze dann auch bitte gleich das Syntaxhighlighting...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1498076</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1498076</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 25 Apr 2008 12:51:14 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Fri, 25 Apr 2008 18:11:46 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">char coperator, auswahl='j';

while (auswahl=='j' || auswahl=='J')
.....
}
</code></pre>
<p>???</p>
<pre><code class="language-cpp">//--Vergleich der Operatoren mit Rechnung---------
while (coperator !='/' || coperator != '*' || coperator != '+'||coperator !='-')
</code></pre>
<p>???</p>
<p>Da fehlt aber noch ein wenig was oder?<br />
Lese mal bitte ein Buch über C++, und es gibt auch Leerzeichen, das ist ja furchtbar.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1498229</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1498229</guid><dc:creator><![CDATA[seltsamseltsam]]></dc:creator><pubDate>Fri, 25 Apr 2008 18:11:46 GMT</pubDate></item><item><title><![CDATA[Reply to Versteh das nicht!!! on Fri, 25 Apr 2008 19:01:09 GMT]]></title><description><![CDATA[<p>Dein Programm ist voll von Logikfehlern, mal abgesehen vom schlechten Stil und dass es überhaupt nicht funktioniert. Du erwartest doch nicht, dass hier jemand deinen Code neu schreibt? Ich war trotzdem so nett, einige Dinge zu kommentieren, vielleicht fällt dir selber noch etwas auf <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>programmnoob schrieb:</p>
<blockquote>
<pre><code class="language-cpp">//--------------------------------------------------------------------------- 

#pragma hdrstop 
#include &lt;iostream.h&gt;  // iostream.h ist veraltet. Benutze iostream
//--------------------------------------------------------------------------- 

#pragma argsused // bist du sicher, dass du diese Pragmas brauchst? Kennst du deren Auswirkungen überhaupt?
int main() 
{ 

double zahl1, zahl2, ergebnis; 
char coperator, auswahl='j'; 

while (auswahl=='j' || auswahl=='J') // sag mir einen Fall, in dem auswahl != 'j' ist.
{ 

cout&lt;&lt;&quot;--------Taschenrechner-------\n&quot;; 
cout&lt;&lt;&quot;-----------------------------\n&quot;; 

cout&lt;&lt;&quot;zahl eingeben \n&quot;; 
cin&gt;&gt;zahl1; 

cout&lt;&lt;&quot;operator eingeben \n&quot;; 
cin&gt;&gt;coperator; 

cout&lt;&lt;&quot;zahl eingeben \n&quot;; 
cin&gt;&gt;zahl2; 

//--Vergleich der Operatoren mit Rechnung--------- 
// Die while-Schleife wird so lange ausgeführt, wie coperator keines der vier Zeichen ist.
while (coperator !='/' || coperator != '*' || coperator != '+'||coperator !='-') { 

switch(coperator) 
{ 

case '*': ergebnis=zahl1*zahl2; cout&lt;&lt;zahl1&lt;&lt;&quot; &quot;&lt;&lt;coperator&lt;&lt;&quot; &quot;&lt;&lt;zahl2&lt;&lt;&quot; = &quot; &lt;&lt; ergebnis&lt;&lt;endl&lt;&lt;endl; 

break; 

case '/': ergebnis=zahl1/zahl2; cout&lt;&lt;zahl1&lt;&lt;&quot; &quot;&lt;&lt;coperator&lt;&lt;&quot; &quot;&lt;&lt;zahl2&lt;&lt;&quot; = &quot; &lt;&lt; ergebnis&lt;&lt;endl&lt;&lt;endl; 

break; 

case '+': ergebnis=zahl1+zahl2; cout&lt;&lt;zahl1&lt;&lt;&quot; &quot;&lt;&lt;coperator&lt;&lt;&quot; &quot;&lt;&lt;zahl2&lt;&lt;&quot; = &quot; &lt;&lt; ergebnis&lt;&lt;endl&lt;&lt;endl; 

break; 

case '-': ergebnis=zahl1-zahl2; cout&lt;&lt;zahl1&lt;&lt;&quot; &quot;&lt;&lt;coperator&lt;&lt;&quot; &quot;&lt;&lt;zahl2&lt;&lt;&quot; = &quot; &lt;&lt; ergebnis&lt;&lt;endl&lt;&lt;endl; 

break; 

default: cout&lt;&lt;&quot;neues rechenzeichen eingeben\n&quot;;cin&gt;&gt;coperator; 

} 
} 
cout&lt;&lt;&quot;nochmal&quot;; 
cin&gt;&gt;auswahl; 

system (&quot;Pause&quot;); 
} 

getchar(); // was soll den das? Du hast ja bereits system(&quot;Pause&quot;).
return 0; // überflüssig, du befindest dich am Ende von main()
}
</code></pre>
</blockquote>
<p>Zum schlechten Stil noch: Benutze in Zukunft [ cpp ]-Tags. Die Strukturierung deines Codes ist zudem grauenhaft (Einrückung, Zeilenabstände, Blöcke, etc.). Die <em>cout</em>-Anweisungen im <em>switch</em>-Block könntest du zu einer zusammenfassen. Benutze <em>using namespace std;</em> oder schreibe <em>std::</em> vor alle <em>cout</em> und <em>cin</em>, sonst wird das nicht gehen.</p>
<p>BTW: Dein Name spricht für sich. Es bringt wohl am meisten, wenn du zuerst ordentlich C++ lernst und dann noch einmal neu mit deinem Programm beginnst. So kommst du nämlich nicht weit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1498254</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1498254</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Fri, 25 Apr 2008 19:01:09 GMT</pubDate></item></channel></rss>