<?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[code]]></title><description><![CDATA[<pre><code class="language-cpp">[#include &lt;cmath&gt; 
#include &lt;iostream&gt; 

using namespace std; 

int main(int argc, char *argv[]) 
{ 
int bit0,bit1,bit2,bit3,bit4,bit5,bit6,bit7; 
cout&lt;&lt;&quot;bit0&quot;; 
cin&gt;&gt;bit0; 
cout&lt;&lt;&quot;bit1&quot;; 
cin&gt;&gt;bit1; 
cout&lt;&lt;&quot;bit2&quot;; 
cin&gt;&gt;bit2; 
cout&lt;&lt;&quot;bit3&quot;; 
cin&gt;&gt;bit3; 
cout&lt;&lt;&quot;bit4&quot;; 
cin&gt;&gt;bit4; 
cout&lt;&lt;&quot;bit5&quot;; 
cin&gt;&gt;bit5; 
cout&lt;&lt;&quot;bit6&quot;; 
cin&gt;&gt;bit6; 
cout&lt;&lt;&quot;bit7&quot;; 
cin&gt;&gt;bit7; 

cout &lt;&lt; ((pow(2,7)* bit7)+(pow(2,6)*bit6)+ (pow(2,5)*bit5)+ (pow(2,4) //der fehler 
*bit4)+(pow(2,3)*bit3)+(pow(2,2)*bit2)+(pow(2,1) 
*bit2)+(pow(2,0)bit0) )&lt;&lt;endl; 
system(&quot;PAUSE&quot;); 
return EXIT_SUCCESS; 
} )
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/132966/code</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 17:06:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/132966.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Jan 2006 13:17:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to code on Sat, 14 Jan 2006 13:17:09 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">[#include &lt;cmath&gt; 
#include &lt;iostream&gt; 

using namespace std; 

int main(int argc, char *argv[]) 
{ 
int bit0,bit1,bit2,bit3,bit4,bit5,bit6,bit7; 
cout&lt;&lt;&quot;bit0&quot;; 
cin&gt;&gt;bit0; 
cout&lt;&lt;&quot;bit1&quot;; 
cin&gt;&gt;bit1; 
cout&lt;&lt;&quot;bit2&quot;; 
cin&gt;&gt;bit2; 
cout&lt;&lt;&quot;bit3&quot;; 
cin&gt;&gt;bit3; 
cout&lt;&lt;&quot;bit4&quot;; 
cin&gt;&gt;bit4; 
cout&lt;&lt;&quot;bit5&quot;; 
cin&gt;&gt;bit5; 
cout&lt;&lt;&quot;bit6&quot;; 
cin&gt;&gt;bit6; 
cout&lt;&lt;&quot;bit7&quot;; 
cin&gt;&gt;bit7; 

cout &lt;&lt; ((pow(2,7)* bit7)+(pow(2,6)*bit6)+ (pow(2,5)*bit5)+ (pow(2,4) //der fehler 
*bit4)+(pow(2,3)*bit3)+(pow(2,2)*bit2)+(pow(2,1) 
*bit2)+(pow(2,0)bit0) )&lt;&lt;endl; 
system(&quot;PAUSE&quot;); 
return EXIT_SUCCESS; 
} )
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/966319</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/966319</guid><dc:creator><![CDATA[toni733]]></dc:creator><pubDate>Sat, 14 Jan 2006 13:17:09 GMT</pubDate></item><item><title><![CDATA[Reply to code on Sat, 14 Jan 2006 13:19:19 GMT]]></title><description><![CDATA[<p>es ist unten auch<br />
ich wollte etvas probieren<br />
kann jemand sagen wo der fehler sthet?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/966324</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/966324</guid><dc:creator><![CDATA[toni733]]></dc:creator><pubDate>Sat, 14 Jan 2006 13:19:19 GMT</pubDate></item><item><title><![CDATA[Reply to code on Sat, 14 Jan 2006 14:17:40 GMT]]></title><description><![CDATA[<p>toni733 schrieb:</p>
<blockquote>
<pre><code class="language-cpp">(pow(2,1)
*bit2)
</code></pre>
</blockquote>
<p>Sollte wohl eher (pow(2,1)*bit1) lauten?</p>
<p>btw:<br />
Bitdaten baut man nicht mit pow() zusammen, das ist viel zu lahm. Für sowas verwendet man bitweise arbeitende Operatoren: &lt;&lt; &gt;&gt; &amp; | ^<br />
Zur Not kann man für den Code auch Bitfelder verwenden.</p>
<p>Und überdenke nochmal deinen Stil, etwas leserlicher und der Fehler wäre dir sofort aufgefallen:</p>
<pre><code class="language-cpp">cout &lt;&lt;
    (
        (pow(2,7)*bit7)+
        (pow(2,6)*bit6)+
        (pow(2,5)*bit5)+
        (pow(2,4)*bit4)+
        (pow(2,3)*bit3)+
        (pow(2,2)*bit2)+
        (pow(2,1)*bit2)+
        (pow(2,0)bit0)
    )
    &lt;&lt; endl;
</code></pre>
<p>Wie du siehst, es gibt noch einen weiteren Fehler.</p>
<p>Und noch zwei Tipps für die Zukunft:<br />
1. Verwende aussagekräftige Threadtitel. Es soll doch tatsächlich Leute geben, die auch mal die Forensuche benutzen.<br />
2. Wenn du Fehler hast, dann spezifiziere diese. ZB indem du die Fehlermeldungen mit hinschreibst, die dein Compiler ausspuckt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/966363</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/966363</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Sat, 14 Jan 2006 14:17:40 GMT</pubDate></item><item><title><![CDATA[Reply to code on Sat, 14 Jan 2006 14:20:55 GMT]]></title><description><![CDATA[<p>3. Crossposts solten unbedingt vermieden werden (das hier ist schon der 3. Beitrag zum dem &quot;code&quot;).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/966365</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/966365</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 14 Jan 2006 14:20:55 GMT</pubDate></item></channel></rss>