<?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[Zugriff auf einzelne Bytes]]></title><description><![CDATA[<p>Hallo</p>
<p>Soweit ich weiss ist im C++ Standard nur festgelegt, dass ein char &lt;= short ist und ein short mindestens 16 Bit hat. Sehe ich das richtig, dass es unter Umständen auf einem System nicht möglich ist, einzelne Bytes zu adressieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/193860/zugriff-auf-einzelne-bytes</link><generator>RSS for Node</generator><lastBuildDate>Mon, 28 Sep 2026 07:28:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/193860.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Oct 2007 06:09:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 06:09:49 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Soweit ich weiss ist im C++ Standard nur festgelegt, dass ein char &lt;= short ist und ein short mindestens 16 Bit hat. Sehe ich das richtig, dass es unter Umständen auf einem System nicht möglich ist, einzelne Bytes zu adressieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375659</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375659</guid><dc:creator><![CDATA[__Stefan__]]></dc:creator><pubDate>Mon, 01 Oct 2007 06:09:49 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 06:11:57 GMT]]></title><description><![CDATA[<p>Klar kannst du - char entspricht einem Byte (auch wenn's größer sein kann als 8 Bit) und über ein char-Array/Zeiger erreichst du jedes Byte deines Speichers (von SegFaults mal abgesehen).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375661</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375661</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 01 Oct 2007 06:11:57 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 06:26:35 GMT]]></title><description><![CDATA[<p>Aber man muss dann mit bit shifting und maskierung arbeiten?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375672</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375672</guid><dc:creator><![CDATA[__Stefan__]]></dc:creator><pubDate>Mon, 01 Oct 2007 06:26:35 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 06:27:31 GMT]]></title><description><![CDATA[<p>Wieso das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375673</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375673</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 01 Oct 2007 06:27:31 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 06:39:47 GMT]]></title><description><![CDATA[<p>Wenn ein char 16 Bit hat, und ich ein Array von chars habe, dann springt er doch von Element zu Element um 16 Bit weiter, nicht? Das heisst, ein char besteht eigentlich aus zwei Bytes.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375677</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375677</guid><dc:creator><![CDATA[__Stefan__]]></dc:creator><pubDate>Mon, 01 Oct 2007 06:39:47 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 06:41:40 GMT]]></title><description><![CDATA[<p><strong>Stefan</strong> schrieb:</p>
<blockquote>
<p>Wenn ein char 16 Bit hat, und ich ein Array von chars habe, dann springt er doch von Element zu Element um 16 Bit weiter, nicht? Das heisst, ein char besteht eigentlich aus zwei Bytes.</p>
</blockquote>
<p>Nach den Regeln der Sprache besteht dann ein Byte aus 16 Bit, nicht ein char aus zwei Byte. Ein char (oder Byte) ist immer die kleinste adressierbare Einheit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375678</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375678</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Mon, 01 Oct 2007 06:41:40 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 07:33:28 GMT]]></title><description><![CDATA[<p>LordJaxom schrieb:</p>
<blockquote>
<p><strong>Stefan</strong> schrieb:</p>
<blockquote>
<p>Wenn ein char 16 Bit hat, und ich ein Array von chars habe, dann springt er doch von Element zu Element um 16 Bit weiter, nicht? Das heisst, ein char besteht eigentlich aus zwei Bytes.</p>
</blockquote>
<p>Nach den Regeln der Sprache besteht dann ein Byte aus 16 Bit, nicht ein char aus zwei Byte. Ein char (oder Byte) ist immer die kleinste adressierbare Einheit.</p>
</blockquote>
<p>...und deshalb muss er auf einem solchen system logische verknüpfungen und shifts benutzen, wenn er 8-bittige datenverarbeitung machen will.<br />
<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/1375703</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375703</guid><dc:creator><![CDATA[Apeman]]></dc:creator><pubDate>Mon, 01 Oct 2007 07:33:28 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 09:51:39 GMT]]></title><description><![CDATA[<p>Apeman schrieb:</p>
<blockquote>
<p>...und deshalb muss er auf einem solchen system logische verknüpfungen und shifts benutzen, wenn er 8-bittige datenverarbeitung machen will.<br />
<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>Muss man nicht nur darauf achten, dass der Überlauf nicht mehr bei 256 ist? Ich meine, wenn man Werte &lt;256 zuweist, verhalten sich die größeren Bytes doch genauso..?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375817</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375817</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Mon, 01 Oct 2007 09:51:39 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 10:24:14 GMT]]></title><description><![CDATA[<p>Noch was:</p>
<p>Wenn ein char 16 Bit ist, und ich ein char in ein File schreibe, hat es dann in dem File zwei Zeichen?</p>
<p>Und: liefert sizeof die grösse in Bytes oder chars?<br />
<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/1375832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375832</guid><dc:creator><![CDATA[__Stefan__]]></dc:creator><pubDate>Mon, 01 Oct 2007 10:24:14 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 10:25:26 GMT]]></title><description><![CDATA[<p>Badestrand schrieb:</p>
<blockquote>
<p>Apeman schrieb:</p>
<blockquote>
<p>...und deshalb muss er auf einem solchen system logische verknüpfungen und shifts benutzen, wenn er 8-bittige datenverarbeitung machen will.<br />
<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>Muss man nicht nur darauf achten, dass der Überlauf nicht mehr bei 256 ist? Ich meine, wenn man Werte &lt;256 zuweist, verhalten sich die größeren Bytes doch genauso..?</p>
</blockquote>
<p>stefan meinte ja arrays. auf einem system, das 16-bittige chars hat, kann man sich ohne shift und or kein lückenloses array aus 8-bit werten schaffen.<br />
<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><strong>Stefan</strong> schrieb:</p>
<blockquote>
<p>Wenn ein char 16 Bit ist, und ich ein char in ein File schreibe, hat es dann in dem File zwei Zeichen?</p>
</blockquote>
<p>nein, es ist ein zeichen, aber das zeichen ist 16 bits breit <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/1375833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375833</guid><dc:creator><![CDATA[Apeman]]></dc:creator><pubDate>Mon, 01 Oct 2007 10:25:26 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 10:30:26 GMT]]></title><description><![CDATA[<p>Apeman schrieb:</p>
<blockquote>
<p>Badestrand schrieb:</p>
<blockquote>
<p>Apeman schrieb:</p>
<blockquote>
<p>...und deshalb muss er auf einem solchen system logische verknüpfungen und shifts benutzen, wenn er 8-bittige datenverarbeitung machen will.<br />
<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>Muss man nicht nur darauf achten, dass der Überlauf nicht mehr bei 256 ist? Ich meine, wenn man Werte &lt;256 zuweist, verhalten sich die größeren Bytes doch genauso..?</p>
</blockquote>
<p>stefan meinte ja arrays. auf einem system, das 16-bittige chars hat, kann man sich ohne shift und or kein lückenloses array aus 8-bit werten schaffen.<br />
<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><strong>Stefan</strong> schrieb:</p>
<blockquote>
<p>Wenn ein char 16 Bit ist, und ich ein char in ein File schreibe, hat es dann in dem File zwei Zeichen?</p>
</blockquote>
<p>nein, es ist ein zeichen, aber das zeichen ist 16 bits breit <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>
</blockquote>
<p>Was ist, wenn ich das File auf einem Computer öffne, wo ein char nur 8 Bit gross ist? Sehe ich dann zwei zeichen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375837</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375837</guid><dc:creator><![CDATA[__Stefan__]]></dc:creator><pubDate>Mon, 01 Oct 2007 10:30:26 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 10:33:42 GMT]]></title><description><![CDATA[<p>Apeman schrieb:</p>
<blockquote>
<p>stefan meinte ja arrays. auf einem system, das 16-bittige chars hat, kann man sich ohne shift und or kein lückenloses array aus 8-bit werten schaffen.</p>
</blockquote>
<p>Aber kann man sich dann nicht einfach mit einem 16-Bit-Array zufriedengeben, solange sich die Operationen darauf gleich verhalten?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375842</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375842</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Mon, 01 Oct 2007 10:33:42 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf einzelne Bytes on Mon, 01 Oct 2007 10:41:10 GMT]]></title><description><![CDATA[<p><strong>Stefan</strong> schrieb:</p>
<blockquote>
<p>Was ist, wenn ich das File auf einem Computer öffne, wo ein char nur 8 Bit gross ist? Sehe ich dann zwei zeichen?</p>
</blockquote>
<p>ja, auf diesem system ist das file (jetzt mal in systemabhängigen chars gemessen) doppelt so gross.</p>
<p>Badestrand schrieb:</p>
<blockquote>
<p>Apeman schrieb:</p>
<blockquote>
<p>stefan meinte ja arrays. auf einem system, das 16-bittige chars hat, kann man sich ohne shift und or kein lückenloses array aus 8-bit werten schaffen.</p>
</blockquote>
<p>Aber kann man sich dann nicht einfach mit einem 16-Bit-Array zufriedengeben, solange sich die Operationen darauf gleich verhalten?</p>
</blockquote>
<p>intern schon, aber für ein und -ausgaben braucht man manchmal echte byte-arrays.<br />
<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/1375849</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375849</guid><dc:creator><![CDATA[Apeman]]></dc:creator><pubDate>Mon, 01 Oct 2007 10:41:10 GMT</pubDate></item></channel></rss>