<?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[bitset]]></title><description><![CDATA[<p>Bei folgendem Beispiel aus dem C++ Primer:</p>
<pre><code class="language-cpp">//bitvec1 ist kleiner als der Initialisierer.
bitset&lt;16&gt; bitvec1(0xffff); // Die Bits 0 bis 15 werden 
                            // auf 1 gesetzt.
</code></pre>
<p>Ist bitvec1 kleiner als der Initialisierer, weil der Initialisierer vom Typ &quot;unsigned long&quot; ist? (Wenn ja, wie kann eine literal konstante vom Typ unsigned long sein, die ist halt einfach ein &quot;Zahlentyp&quot;, aber was für einer dass hab ich doch gar nicht gesagt? So würde ich es ja noch verstehen:</p>
<pre><code class="language-cpp">const unsigned long temp = 0xffff;
bitset&lt;16&gt; bitvec1(0xffff);
</code></pre>
<p>Oder ist bitvec1 kleiner als der Initialisierer, weil &quot;0xffff&quot; (65535) größer ist als dass was in 16Bit (2Byte = 65335) reinpasst?<br />
Da hab ich irgendwie noch n Verständnisproblem. Bitte extrem verständliche Erklärungen schreiben <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> .</p>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/230550/bitset</link><generator>RSS for Node</generator><lastBuildDate>Sun, 27 Sep 2026 06:37:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/230550.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 28 Dec 2008 18:16:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to bitset on Sun, 28 Dec 2008 18:16:55 GMT]]></title><description><![CDATA[<p>Bei folgendem Beispiel aus dem C++ Primer:</p>
<pre><code class="language-cpp">//bitvec1 ist kleiner als der Initialisierer.
bitset&lt;16&gt; bitvec1(0xffff); // Die Bits 0 bis 15 werden 
                            // auf 1 gesetzt.
</code></pre>
<p>Ist bitvec1 kleiner als der Initialisierer, weil der Initialisierer vom Typ &quot;unsigned long&quot; ist? (Wenn ja, wie kann eine literal konstante vom Typ unsigned long sein, die ist halt einfach ein &quot;Zahlentyp&quot;, aber was für einer dass hab ich doch gar nicht gesagt? So würde ich es ja noch verstehen:</p>
<pre><code class="language-cpp">const unsigned long temp = 0xffff;
bitset&lt;16&gt; bitvec1(0xffff);
</code></pre>
<p>Oder ist bitvec1 kleiner als der Initialisierer, weil &quot;0xffff&quot; (65535) größer ist als dass was in 16Bit (2Byte = 65335) reinpasst?<br />
Da hab ich irgendwie noch n Verständnisproblem. Bitte extrem verständliche Erklärungen schreiben <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> .</p>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636582</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Sun, 28 Dec 2008 18:16:55 GMT</pubDate></item><item><title><![CDATA[Reply to bitset on Sun, 28 Dec 2008 18:49:18 GMT]]></title><description><![CDATA[<p>Per Standard ist das folgende definiert:</p>
<pre><code class="language-cpp">// Kein Postfix
454;  // Von irgendeinem signed integer (int, long int)
0xFF; // Von irgendeinem integer (int, long int, unsigned int, unsigned long int)
054;  // Von irgendeinem integer (int, long int, unsigned int, unsigned long int)

// u oder U als Postfix
454u;  // Von irgendeinem unsigned integer (unsigned int, unsigned long int)
0xFFu; // &quot;
054u;  // &quot;

// l oder L als Postfix
454l;  // signed long int
0xFFl; // signed long int, unsigned long int
054;   // signed long int, unsigned long int

// u oder U und l oder L als Postfix
454ul;  // unsigned long int
0xFFul; // &quot;
054ul;  // &quot;
</code></pre>
<p>Da ein <code>bitset</code> Konstruktor einen <code>unsigned long</code> erwartet, wird der Kompiler für <code>0xffff</code> wahrscheinlich den Typ <code>unsigned long int</code> wählen.</p>
<p>Grüssli</p>
<p>PS: Ich hoffe ich habe die Liste richtig aus meinem Kopf rauskopiert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636589</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Sun, 28 Dec 2008 18:49:18 GMT</pubDate></item><item><title><![CDATA[Reply to bitset on Mon, 29 Dec 2008 00:02:44 GMT]]></title><description><![CDATA[<p>Dravere schrieb:</p>
<blockquote>
<p>PS: Ich hoffe ich habe die Liste richtig aus meinem Kopf rauskopiert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
</blockquote>
<p>Mach mal nen firmware-update wenn die aktuelle nicht mal copy&amp;paste 100%ig unterstützt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
aber sieht so aus, als ob es richtig wäre ^^</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636690</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Mon, 29 Dec 2008 00:02:44 GMT</pubDate></item><item><title><![CDATA[Reply to bitset on Mon, 29 Dec 2008 00:39:55 GMT]]></title><description><![CDATA[<p>Und was ist mit short? Das ist doch auch ein Integer Typ!? Gibts da nichts?</p>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636696</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636696</guid><dc:creator><![CDATA[Stromberg_]]></dc:creator><pubDate>Mon, 29 Dec 2008 00:39:55 GMT</pubDate></item><item><title><![CDATA[Reply to bitset on Mon, 29 Dec 2008 09:21:19 GMT]]></title><description><![CDATA[<p>Seit wann passen in 2 Byte nur 65336 verschiedene Werte anstatt 65536?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636741</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636741</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 29 Dec 2008 09:21:19 GMT</pubDate></item><item><title><![CDATA[Reply to bitset on Mon, 29 Dec 2008 12:41:01 GMT]]></title><description><![CDATA[<p>Ka, äh ich hab dass halt so gelernt dass der Wertebereich von &quot;unsigned short&quot; von 0 - 65335 geht. Stimmt dass jetzt oder nicht?</p>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636805</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636805</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Mon, 29 Dec 2008 12:41:01 GMT</pubDate></item><item><title><![CDATA[Reply to bitset on Mon, 29 Dec 2008 13:28:55 GMT]]></title><description><![CDATA[<p>Stromberg schrieb:</p>
<blockquote>
<p>Ka, äh ich hab dass halt so gelernt dass der Wertebereich von &quot;unsigned short&quot; von 0 - 65335 geht. Stimmt dass jetzt oder nicht?</p>
<p>MfG<br />
Stromberg</p>
</blockquote>
<p>2 Byte = 16 bit = 65536 Möglichkeiten</p>
<p><a href="http://www.google.ch/search?hl=de&amp;client=firefox-a&amp;rls=org.mozilla%3Ade%3Aofficial&amp;hs=V3c&amp;q=2%5E16&amp;btnG=Suche&amp;meta=" rel="nofollow">http://www.google.ch/search?hl=de&amp;client=firefox-a&amp;rls=org.mozilla%3Ade%3Aofficial&amp;hs=V3c&amp;q=2^16&amp;btnG=Suche&amp;meta=</a></p>
<p>EDIT:<br />
Ganzen Link kopieren, nicht anklicken. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636832</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Mon, 29 Dec 2008 13:28:55 GMT</pubDate></item><item><title><![CDATA[Reply to bitset on Mon, 29 Dec 2008 13:54:37 GMT]]></title><description><![CDATA[<p>Was ist dann hier gemeint?<br />
<a href="http://209.85.129.132/search?q=cache:dxZyZlBJkqgJ:seite.hilber.loferer.at/index2.php%3Foption%3Dcom_docman%26task%3Ddoc_view%26gid%3D39%26Itemid%3D72+C%2B%2B+short+65335&amp;hl=de&amp;ct=clnk&amp;cd=4&amp;gl=de&amp;lr=lang_de&amp;client=opera" rel="nofollow">http://209.85.129.132/search?q=cache:dxZyZlBJkqgJ:seite.hilber.loferer.at/index2.php%3Foption%3Dcom_docman%26task%3Ddoc_view%26gid%3D39%26Itemid%3D72+C%2B%2B+short+65335&amp;hl=de&amp;ct=clnk&amp;cd=4&amp;gl=de&amp;lr=lang_de&amp;client=opera</a></p>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636848</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636848</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Mon, 29 Dec 2008 13:54:37 GMT</pubDate></item><item><title><![CDATA[Reply to bitset on Mon, 29 Dec 2008 14:02:32 GMT]]></title><description><![CDATA[<p>Stromberg schrieb:</p>
<blockquote>
<p>Was ist dann hier gemeint?<br />
<a href="http://209.85.129.132/search?q=cache:dxZyZlBJkqgJ:seite.hilber.loferer.at/index2.php%3Foption%3Dcom_docman%26task%3Ddoc_view%26gid%3D39%26Itemid%3D72+C%2B%2B+short+65335&amp;hl=de&amp;ct=clnk&amp;cd=4&amp;gl=de&amp;lr=lang_de&amp;client=opera" rel="nofollow">http://209.85.129.132/search?q=cache:dxZyZlBJkqgJ:seite.hilber.loferer.at/index2.php%3Foption%3Dcom_docman%26task%3Ddoc_view%26gid%3D39%26Itemid%3D72+C%2B%2B+short+65335&amp;hl=de&amp;ct=clnk&amp;cd=4&amp;gl=de&amp;lr=lang_de&amp;client=opera</a></p>
<p>MfG<br />
Stromberg</p>
</blockquote>
<p>Wahrscheinlich Tippfehler.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636850</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636850</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Mon, 29 Dec 2008 14:02:32 GMT</pubDate></item><item><title><![CDATA[Reply to bitset on Mon, 29 Dec 2008 14:03:53 GMT]]></title><description><![CDATA[<p>Damit ist ein Typo gemeint!<br />
Oder aber Windows reserviert die oberen 200 Werte für interne nutzung und zukünftige features <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1636852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1636852</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 29 Dec 2008 14:03:53 GMT</pubDate></item><item><title><![CDATA[Reply to bitset on Mon, 29 Dec 2008 20:43:41 GMT]]></title><description><![CDATA[<p>Stromberg schrieb:</p>
<blockquote>
<p>Ka, äh ich hab dass halt so gelernt dass der Wertebereich von &quot;unsigned short&quot; von 0 - 65335 geht. Stimmt dass jetzt oder nicht?</p>
</blockquote>
<p>Falls du 65536 meinst: Das ist vielleicht häufig so, muss aber nicht so sein. Es ist auch nicht vorgeschrieben, dass <code>short</code> 2 Bytes gross ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1637029</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1637029</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 29 Dec 2008 20:43:41 GMT</pubDate></item></channel></rss>