<?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[Oktal =&amp;gt; Dezimal]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine char Variable:</p>
<p>char buff[] = &quot;7674&quot;</p>
<p>wie kann ich nun diese Oktale Zahl, die als char variable da ist, in eine Dezimale Zahl umwandeln? Also es in eine Integer Variable abspeichern?</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/180677/oktal-gt-dezimal</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 21:41:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/180677.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 05 May 2007 09:08:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Oktal =&amp;gt; Dezimal on Sat, 05 May 2007 09:08:20 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine char Variable:</p>
<p>char buff[] = &quot;7674&quot;</p>
<p>wie kann ich nun diese Oktale Zahl, die als char variable da ist, in eine Dezimale Zahl umwandeln? Also es in eine Integer Variable abspeichern?</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1279169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1279169</guid><dc:creator><![CDATA[bts]]></dc:creator><pubDate>Sat, 05 May 2007 09:08:20 GMT</pubDate></item><item><title><![CDATA[Reply to Oktal =&amp;gt; Dezimal on Sat, 05 May 2007 09:12:00 GMT]]></title><description><![CDATA[<p>Siehe FAQ - &quot;Einmal String nach Zahl und zurück&quot; (fast alle dort genannten Lösungansätze kommen auch mit oktalen und hexadezimalen Zahlen klar).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1279172</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1279172</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Sat, 05 May 2007 09:12:00 GMT</pubDate></item><item><title><![CDATA[Reply to Oktal =&amp;gt; Dezimal on Sat, 05 May 2007 12:10:42 GMT]]></title><description><![CDATA[<p>hi, ich hatte diese Übung analog zu binär so gemacht:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
 #include &lt;string&gt;
  //...
  unsigned long i, z = 0; string buff = (&quot;7674&quot;);
  for ( i = 0; i &lt; buff.length(); i++ ) z = 8 * z + (int)buff[i] - (int)('0');
  cout &lt;&lt; buff &lt;&lt; &quot;Q&quot; &lt;&lt; &quot; = &quot; &lt;&lt; z &lt;&lt; &quot;D&quot; &lt;&lt; endl; 
  // 7674Q = 4028D
</code></pre>
<p>Wichtig ist, dass man den ascii wert der '0' abzieht.</p>
<p>Mir ist noch eingefallen, dass es schneller geht mit Maskierung des high nibbels (Meinung des Tutors):<br />
for ( i = 0; i &lt; buff.length(); i++ ) z = 8 * z + ((int)buff[i]&amp;0x0F);<br />
vg tesu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1279196</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1279196</guid><dc:creator><![CDATA[tesuji]]></dc:creator><pubDate>Sat, 05 May 2007 12:10:42 GMT</pubDate></item></channel></rss>