<?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[double aus char array]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich bekomme über einen Bus eine Zahl die dem double Format entspricht. Also 8byte mit VZ, 11bit Exponent und 53bit Mantisse. Problem ist, daß ich über den Bus nur byteweise empfange. Ich habe also ein array aus chars.<br />
Wie bekomme ich dieses array in eine double Variable?<br />
-einen char Zeiger auf die double Variable um dann &quot;einfach&quot; im Speicher die bytes einzeln drüberbraten mag der compiler nicht<br />
-shiften läßt er mich in einer als double deklarierten Variable auch nicht.</p>
<p>Gibt es noch etwas anderes als die chars bitweise zusammen ziehen und dann stumpf ausrechnen?</p>
<p>Besten Dank schonmal..<br />
Schönen Gruß<br />
Jens</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/118419/double-aus-char-array</link><generator>RSS for Node</generator><lastBuildDate>Fri, 21 Aug 2026 12:24:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/118419.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Aug 2005 21:58:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to double aus char array on Fri, 19 Aug 2005 21:58:17 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich bekomme über einen Bus eine Zahl die dem double Format entspricht. Also 8byte mit VZ, 11bit Exponent und 53bit Mantisse. Problem ist, daß ich über den Bus nur byteweise empfange. Ich habe also ein array aus chars.<br />
Wie bekomme ich dieses array in eine double Variable?<br />
-einen char Zeiger auf die double Variable um dann &quot;einfach&quot; im Speicher die bytes einzeln drüberbraten mag der compiler nicht<br />
-shiften läßt er mich in einer als double deklarierten Variable auch nicht.</p>
<p>Gibt es noch etwas anderes als die chars bitweise zusammen ziehen und dann stumpf ausrechnen?</p>
<p>Besten Dank schonmal..<br />
Schönen Gruß<br />
Jens</p>
]]></description><link>https://www.c-plusplus.net/forum/post/854689</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/854689</guid><dc:creator><![CDATA[Pense]]></dc:creator><pubDate>Fri, 19 Aug 2005 21:58:17 GMT</pubDate></item><item><title><![CDATA[Reply to double aus char array on Fri, 19 Aug 2005 22:04:06 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">char * buffer;
double v = * reinterpret_cast&lt;double*&gt; ( buffer );
</code></pre>
<p>Aber Achtung, das wird wohl auch auf den Compiler ankommen... Ist ziemlich spezifisch mach das nur wenn du genau weißt dass dein Compiler den Double-Wert genau gleich ablegt wie er von der Schnittstelle kommt.</p>
<p>edit: natürlich reinterpret_cast nicht static_cast...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/854695</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/854695</guid><dc:creator><![CDATA[FireFlow]]></dc:creator><pubDate>Fri, 19 Aug 2005 22:04:06 GMT</pubDate></item><item><title><![CDATA[Reply to double aus char array on Fri, 19 Aug 2005 22:08:13 GMT]]></title><description><![CDATA[<p>alternativ</p>
<pre><code class="language-cpp">double *v=(double*)buffer; //bzw reinterpret_cast&lt;double*&gt;(buffer)
</code></pre>
<p>:p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/854697</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/854697</guid><dc:creator><![CDATA[Cpt.Tanga]]></dc:creator><pubDate>Fri, 19 Aug 2005 22:08:13 GMT</pubDate></item><item><title><![CDATA[Reply to double aus char array on Fri, 19 Aug 2005 22:50:20 GMT]]></title><description><![CDATA[<p>/Edit: Liegt ja binär vor, nächste 2 Posts haben recht.</p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/854700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/854700</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Fri, 19 Aug 2005 22:50:20 GMT</pubDate></item><item><title><![CDATA[Reply to double aus char array on Fri, 19 Aug 2005 22:35:56 GMT]]></title><description><![CDATA[<p>ist 'n bischen viel overhead fuer so ne kleine aufgabe. (ausserdem laaangsam).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/854702</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/854702</guid><dc:creator><![CDATA[Cpt.Tanga]]></dc:creator><pubDate>Fri, 19 Aug 2005 22:35:56 GMT</pubDate></item><item><title><![CDATA[Reply to double aus char array on Fri, 19 Aug 2005 22:48:13 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/201">@SideWinder</a>: Les mal was der Threadersteller will. Er hat den Wert binär vorliegen und das eben byte für byte als char.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/854711</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/854711</guid><dc:creator><![CDATA[FireFlow]]></dc:creator><pubDate>Fri, 19 Aug 2005 22:48:13 GMT</pubDate></item><item><title><![CDATA[Reply to double aus char array on Mon, 22 Aug 2005 09:51:51 GMT]]></title><description><![CDATA[<p>Vielen Dank für die schnelle Antworten!</p>
<p>Das scheint zu funktionieren.<br />
Jetzt merke ich erst, daß das gesendete Format doch nicht so ganz passt...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/855931</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/855931</guid><dc:creator><![CDATA[Pense]]></dc:creator><pubDate>Mon, 22 Aug 2005 09:51:51 GMT</pubDate></item></channel></rss>