<?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[Anfängerfrage: Integer aus 3 Byte]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein Programm (nicht von mir), welches einen Wert unterschiedlich darstellt, z.B.:</p>
<p>int 2019</p>
<p>und den gleichen Wert in Form von 3 Byte:</p>
<p>Byte 0 = 225<br />
Byte 1 = 248<br />
Byte 2 = 1</p>
<p>Nun bin ich schon eine ganze Weile am suchen und finde nicht heraus, wie man aus 225 248 1 einen &quot;int 2019&quot; bekommt.</p>
<p>Ein Hinweis auf einen Suchbegriff würde mir schon sehr helfen <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>Danke schonmal !</p>
<p>Grüße<br />
Julian (Newbie)</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/261931/anfängerfrage-integer-aus-3-byte</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 23:41:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/261931.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Feb 2010 17:06:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Anfängerfrage: Integer aus 3 Byte on Thu, 25 Feb 2010 17:06:18 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein Programm (nicht von mir), welches einen Wert unterschiedlich darstellt, z.B.:</p>
<p>int 2019</p>
<p>und den gleichen Wert in Form von 3 Byte:</p>
<p>Byte 0 = 225<br />
Byte 1 = 248<br />
Byte 2 = 1</p>
<p>Nun bin ich schon eine ganze Weile am suchen und finde nicht heraus, wie man aus 225 248 1 einen &quot;int 2019&quot; bekommt.</p>
<p>Ein Hinweis auf einen Suchbegriff würde mir schon sehr helfen <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>Danke schonmal !</p>
<p>Grüße<br />
Julian (Newbie)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1861408</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1861408</guid><dc:creator><![CDATA[Julian3]]></dc:creator><pubDate>Thu, 25 Feb 2010 17:06:18 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerfrage: Integer aus 3 Byte on Thu, 25 Feb 2010 18:05:53 GMT]]></title><description><![CDATA[<p>Bitoperationen ist das Stichwort.<br />
Z.B.</p>
<pre><code class="language-cpp">int val=(byte2&lt;&lt;16) | (byte1&lt;&lt;8) | byte0;
</code></pre>
<p>Das gibt aber 129249 und nicht 2019.<br />
Es muss sich hier schon um eine sehr abenteuerliche Darstellungsweise handeln.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1861446</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1861446</guid><dc:creator><![CDATA[Athar]]></dc:creator><pubDate>Thu, 25 Feb 2010 18:05:53 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerfrage: Integer aus 3 Byte on Thu, 25 Feb 2010 18:23:56 GMT]]></title><description><![CDATA[<p>Athar schrieb:</p>
<blockquote>
<p>Bitoperationen ist das Stichwort.<br />
Z.B.</p>
<pre><code class="language-cpp">int val=(byte2&lt;&lt;16) | (byte1&lt;&lt;8) | byte0;
</code></pre>
<p>Das gibt aber 129249 und nicht 2019.<br />
Es muss sich hier schon um eine sehr abenteuerliche Darstellungsweise handeln.</p>
</blockquote>
<p>Bitoperationen berücksichtigen hier die Endianess nicht genügend.<br />
Sieh Dir die Bytes an, indem Du das hier probierst:</p>
<pre><code class="language-cpp">unsigned char a[sizeof int];
        int b = 2019;
        *(int*)a = b;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1861455</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1861455</guid><dc:creator><![CDATA[otto8]]></dc:creator><pubDate>Thu, 25 Feb 2010 18:23:56 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerfrage: Integer aus 3 Byte on Thu, 25 Feb 2010 18:49:26 GMT]]></title><description><![CDATA[<p>otto8 schrieb:</p>
<blockquote>
<p>Bitoperationen berücksichtigen hier die Endianess nicht genügend.</p>
</blockquote>
<p>Da Big-Endian hier noch weitaus weniger Sinn machen würde (14809089), habe ich für das Beispiel Little-Endian gewählt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1861464</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1861464</guid><dc:creator><![CDATA[Athar]]></dc:creator><pubDate>Thu, 25 Feb 2010 18:49:26 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerfrage: Integer aus 3 Byte on Thu, 25 Feb 2010 19:35:22 GMT]]></title><description><![CDATA[<p>Super, danke !</p>
<p>Jetzt bin ich schonmal ein ganzes Stück weiter.</p>
<p>Dieser Wert (129249) wird in dem Programm auch angezeigt, aber nur in Zusammenhang mit dem anderen Wert 2019.</p>
<p>Hier mal ein Beispiel, was in dem Prog ausgegeben wird:</p>
<p>ReadSSI return value: 129249<br />
Position: 2019<br />
...<br />
ReadSSI return value: 157345<br />
Position: 2458<br />
...<br />
ReadSSI return value: 45025<br />
Position: 703<br />
...</p>
<p>Kann der Wert für &quot;Position&quot; aus dem Wert von &quot;ReadSSI return value&quot; abgeleitet worden sein ?<br />
Stehe auf dem Schlauch ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1861485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1861485</guid><dc:creator><![CDATA[Julian3]]></dc:creator><pubDate>Thu, 25 Feb 2010 19:35:22 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerfrage: Integer aus 3 Byte on Thu, 25 Feb 2010 19:42:09 GMT]]></title><description><![CDATA[<p>Ja, mit /64.<br />
Das ist also eine binäre Festkommazahl mit 6 Nachkommastellen.<br />
Oder Kacheln sind 64cm lang und breit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1861487</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1861487</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Thu, 25 Feb 2010 19:42:09 GMT</pubDate></item><item><title><![CDATA[Reply to Anfängerfrage: Integer aus 3 Byte on Thu, 25 Feb 2010 20:17:25 GMT]]></title><description><![CDATA[<p>Das ist die Lösung. Ihr seid Spitze <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>Vielen Dank ! <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/1861499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1861499</guid><dc:creator><![CDATA[Julian3]]></dc:creator><pubDate>Thu, 25 Feb 2010 20:17:25 GMT</pubDate></item></channel></rss>