<?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[Char Array auf Struktur casten]]></title><description><![CDATA[<p>Hi zusammen,</p>
<p>habe gerade einen kleinen hänger und bekomme mein Char Array nicht auf meine Struktur gecastet. Das ganze sieht so aus:</p>
<pre><code class="language-cpp">struct stMyStruct {
unsigned int Int1;
unsigned int Int2;
unsigned int Int3;
} tMyStruct

char cBuffer[6];

tMyStruct TheStruct;

TheStruct = (tMyStruct)cBuffer; // Geht leider nicht :-(
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/128624/char-array-auf-struktur-casten</link><generator>RSS for Node</generator><lastBuildDate>Tue, 25 Aug 2026 20:07:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/128624.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Dec 2005 16:02:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Char Array auf Struktur casten on Mon, 05 Dec 2005 16:02:59 GMT]]></title><description><![CDATA[<p>Hi zusammen,</p>
<p>habe gerade einen kleinen hänger und bekomme mein Char Array nicht auf meine Struktur gecastet. Das ganze sieht so aus:</p>
<pre><code class="language-cpp">struct stMyStruct {
unsigned int Int1;
unsigned int Int2;
unsigned int Int3;
} tMyStruct

char cBuffer[6];

tMyStruct TheStruct;

TheStruct = (tMyStruct)cBuffer; // Geht leider nicht :-(
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/935090</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/935090</guid><dc:creator><![CDATA[TimTulpe]]></dc:creator><pubDate>Mon, 05 Dec 2005 16:02:59 GMT</pubDate></item><item><title><![CDATA[Reply to Char Array auf Struktur casten on Mon, 05 Dec 2005 16:04:44 GMT]]></title><description><![CDATA[<p>struct stMyStruct ist natürlich als typedef deklariert !!.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/935092</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/935092</guid><dc:creator><![CDATA[TimTulpe]]></dc:creator><pubDate>Mon, 05 Dec 2005 16:04:44 GMT</pubDate></item><item><title><![CDATA[Reply to Char Array auf Struktur casten on Mon, 05 Dec 2005 17:35:17 GMT]]></title><description><![CDATA[<p>Das folgende ist weder besonders elegant noch sehr sicher - also solltest du vor Anwendung <strong>GANZ GENAU</strong> wissen, was du da tust:</p>
<pre><code class="language-cpp">TheStruct=*(reinterpret_cast&lt;tMyStruct*&gt;&amp;cBuffer);
</code></pre>
<p>Aber: Wozu brauchst du das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/935193</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/935193</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 05 Dec 2005 17:35:17 GMT</pubDate></item></channel></rss>