<?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[Binär Zahl in Dezimal Zahl]]></title><description><![CDATA[<p>Hallo ich habe folgendes Programm</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main(int argc, char* argv[])
{

char binaer_zahl[256];
int i;
int wert;

cout&lt;&lt;&quot;Binaerzahl eingeben: &quot;;
cin&gt;&gt;binaer_zahl;

        for ( wert = i = 0 ; binaer_zahl [i] ; i++)
        {
        wert = wert * 2 + binaer_zahl [i] - 48;

        }

cout&lt;&lt;&quot;Dezimalzahl: &quot; &lt;&lt; wert &lt;&lt; &quot;\n&quot;;

           //1111111111 = 1023

return 0; 
}
</code></pre>
<p>Wenn ich z.b. eine 1111111111 eingebe dann kommt als Ergebniss eine 1023 raus<br />
Aber ich will das die Ausgabe so aussieht: 102.3 es soll also alle 3 Zahlen ein Punkt gesetzt werden.</p>
<p>Hat wer eine Idee wie so etwas gehen könnte ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/231559/binär-zahl-in-dezimal-zahl</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 20:26:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/231559.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Jan 2009 16:10:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Binär Zahl in Dezimal Zahl on Mon, 12 Jan 2009 16:10:47 GMT]]></title><description><![CDATA[<p>Hallo ich habe folgendes Programm</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main(int argc, char* argv[])
{

char binaer_zahl[256];
int i;
int wert;

cout&lt;&lt;&quot;Binaerzahl eingeben: &quot;;
cin&gt;&gt;binaer_zahl;

        for ( wert = i = 0 ; binaer_zahl [i] ; i++)
        {
        wert = wert * 2 + binaer_zahl [i] - 48;

        }

cout&lt;&lt;&quot;Dezimalzahl: &quot; &lt;&lt; wert &lt;&lt; &quot;\n&quot;;

           //1111111111 = 1023

return 0; 
}
</code></pre>
<p>Wenn ich z.b. eine 1111111111 eingebe dann kommt als Ergebniss eine 1023 raus<br />
Aber ich will das die Ausgabe so aussieht: 102.3 es soll also alle 3 Zahlen ein Punkt gesetzt werden.</p>
<p>Hat wer eine Idee wie so etwas gehen könnte ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1644024</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1644024</guid><dc:creator><![CDATA[binär]]></dc:creator><pubDate>Mon, 12 Jan 2009 16:10:47 GMT</pubDate></item><item><title><![CDATA[Reply to Binär Zahl in Dezimal Zahl on Mon, 12 Jan 2009 16:13:37 GMT]]></title><description><![CDATA[<p>Statt int, für <em>wert</em>, eine Zeichenkette verwenden. Und die Punkte beim umwandeln einfügen. Frage am Rande: Wieso willst du das denn machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1644027</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1644027</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Mon, 12 Jan 2009 16:13:37 GMT</pubDate></item><item><title><![CDATA[Reply to Binär Zahl in Dezimal Zahl on Mon, 12 Jan 2009 16:17:42 GMT]]></title><description><![CDATA[<p>Naja ist eine Übung ausser Schule.</p>
<p>Ich werds nachher mal mit nem Array probieren ty.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1644031</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1644031</guid><dc:creator><![CDATA[binär]]></dc:creator><pubDate>Mon, 12 Jan 2009 16:17:42 GMT</pubDate></item><item><title><![CDATA[Reply to Binär Zahl in Dezimal Zahl on Mon, 12 Jan 2009 17:17:09 GMT]]></title><description><![CDATA[<p>Besser als ein <code>char</code> -Array wäre <code>std::string</code> für Zeichenketten, das ist flexibler und einfacher zu bedienen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1644062</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1644062</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 12 Jan 2009 17:17:09 GMT</pubDate></item></channel></rss>