<?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[8bit breiten Wert in 8 einzelne Bits umwandeln??]]></title><description><![CDATA[<p>Hi,</p>
<p>habe schon im Bereich MFC geposted, zur Sicherheit auch noch mal hier.<br />
Ich habe einen 8 Bit breiten Wert in einer Variable(ULONG) gespeichert.<br />
Ich will aber nur ein einzelnes bit aus dem 8Bit breiten Wert haben.</p>
<p>Wie komme ich da ran, kann man den 8Bit breiten Wert irgendwie in 8 einzelne Bits aufteilen.</p>
<p>Mit der suche habe ich leider nix gefunden.</p>
<p>Gruß Ronn</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/122394/8bit-breiten-wert-in-8-einzelne-bits-umwandeln</link><generator>RSS for Node</generator><lastBuildDate>Sun, 23 Aug 2026 03:39:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/122394.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Oct 2005 11:34:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 8bit breiten Wert in 8 einzelne Bits umwandeln?? on Wed, 05 Oct 2005 11:34:38 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>habe schon im Bereich MFC geposted, zur Sicherheit auch noch mal hier.<br />
Ich habe einen 8 Bit breiten Wert in einer Variable(ULONG) gespeichert.<br />
Ich will aber nur ein einzelnes bit aus dem 8Bit breiten Wert haben.</p>
<p>Wie komme ich da ran, kann man den 8Bit breiten Wert irgendwie in 8 einzelne Bits aufteilen.</p>
<p>Mit der suche habe ich leider nix gefunden.</p>
<p>Gruß Ronn</p>
]]></description><link>https://www.c-plusplus.net/forum/post/885588</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/885588</guid><dc:creator><![CDATA[Ronn]]></dc:creator><pubDate>Wed, 05 Oct 2005 11:34:38 GMT</pubDate></item><item><title><![CDATA[Reply to 8bit breiten Wert in 8 einzelne Bits umwandeln?? on Wed, 05 Oct 2005 11:37:33 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">//ausgabe leider rückwärts
do{
   cout&lt;&lt;char('0'+x%2);
   x/=2;
}while(x);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/885592</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/885592</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Wed, 05 Oct 2005 11:37:33 GMT</pubDate></item><item><title><![CDATA[Reply to 8bit breiten Wert in 8 einzelne Bits umwandeln?? on Wed, 05 Oct 2005 11:39:30 GMT]]></title><description><![CDATA[<p>Aufteilen geht schon, aber was spricht gegen</p>
<pre><code class="language-cpp">ULONG i = /* Wert */;
bool bit = i &amp; (1 &lt;&lt; /* Position */);
</code></pre>
<p>?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/885594</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/885594</guid><dc:creator><![CDATA[.filmor]]></dc:creator><pubDate>Wed, 05 Oct 2005 11:39:30 GMT</pubDate></item><item><title><![CDATA[Reply to 8bit breiten Wert in 8 einzelne Bits umwandeln?? on Wed, 05 Oct 2005 12:36:33 GMT]]></title><description><![CDATA[<p>Danke habe es mal mit dem zweiten Beispiel Versucht und ich kann es bei mir einbauen.</p>
<p>Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/885641</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/885641</guid><dc:creator><![CDATA[Ronn]]></dc:creator><pubDate>Wed, 05 Oct 2005 12:36:33 GMT</pubDate></item><item><title><![CDATA[Reply to 8bit breiten Wert in 8 einzelne Bits umwandeln?? on Wed, 05 Oct 2005 14:47:26 GMT]]></title><description><![CDATA[<p>std::bitset</p>
]]></description><link>https://www.c-plusplus.net/forum/post/885778</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/885778</guid><dc:creator><![CDATA[maximAL]]></dc:creator><pubDate>Wed, 05 Oct 2005 14:47:26 GMT</pubDate></item><item><title><![CDATA[Reply to 8bit breiten Wert in 8 einzelne Bits umwandeln?? on Wed, 05 Oct 2005 15:10:46 GMT]]></title><description><![CDATA[<p>recht komfortabel (aber nicht std-konform, glaube ich):</p>
<pre><code class="language-cpp">struct bit8
{
    unsigned char bit1 : 1;
    unsigned char bit1 : 2;
    unsigned char bit1 : 3;
    unsigned char bit1 : 4;
    unsigned char bit1 : 5;
    unsigned char bit1 : 6;
    unsigned char bit1 : 7;
    unsigned char bit1 : 8;
}

std::cout&lt;&lt;reinterpret_cast&lt;bit8&gt;(c).bitX + '0'&lt;&lt;std::endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/885796</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/885796</guid><dc:creator><![CDATA[ness]]></dc:creator><pubDate>Wed, 05 Oct 2005 15:10:46 GMT</pubDate></item></channel></rss>