<?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[Summe aus HEX-Werten]]></title><description><![CDATA[<p>Hi Leute,<br />
brauche auch mal Hilfe.</p>
<p>Habe</p>
<pre><code class="language-cpp">BYTE DataToSend[] = &quot;\x9F\x80\x60\x4E\x00&quot;;
</code></pre>
<p>Prüfsumme sind einfach die Werte auf HEX-Ebene zusammengezählt.<br />
Der calc von Windows rechnet sie mir richtig aus aber ich hatte noch nie mit HEX zu tun.<br />
Daraus muss ich die Prüfsumme berechnen und diese anhängen.<br />
Jemand bitte ne Idee?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/62069/summe-aus-hex-werten</link><generator>RSS for Node</generator><lastBuildDate>Wed, 03 Jun 2026 22:43:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/62069.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Jan 2004 22:21:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Summe aus HEX-Werten on Mon, 19 Jan 2004 22:22:28 GMT]]></title><description><![CDATA[<p>Hi Leute,<br />
brauche auch mal Hilfe.</p>
<p>Habe</p>
<pre><code class="language-cpp">BYTE DataToSend[] = &quot;\x9F\x80\x60\x4E\x00&quot;;
</code></pre>
<p>Prüfsumme sind einfach die Werte auf HEX-Ebene zusammengezählt.<br />
Der calc von Windows rechnet sie mir richtig aus aber ich hatte noch nie mit HEX zu tun.<br />
Daraus muss ich die Prüfsumme berechnen und diese anhängen.<br />
Jemand bitte ne Idee?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/440208</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/440208</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Mon, 19 Jan 2004 22:22:28 GMT</pubDate></item><item><title><![CDATA[Reply to Summe aus HEX-Werten on Mon, 19 Jan 2004 22:44:46 GMT]]></title><description><![CDATA[<p>Ich bin mir nicht sicher, ob ich Dich richtig verstehe. Aber Du willst einfach nur die einzelnen Werte des Arrays addieren, ja? Dann so:</p>
<pre><code class="language-cpp">int chksum = 0;

for(int x = 0; x &lt; (sizeof(DataToSend) / sizeof(DataToSend[0])); ++x)
    chksum += DataToSend[x];
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/440213</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/440213</guid><dc:creator><![CDATA[-King-]]></dc:creator><pubDate>Mon, 19 Jan 2004 22:44:46 GMT</pubDate></item><item><title><![CDATA[Reply to Summe aus HEX-Werten on Mon, 19 Jan 2004 23:08:33 GMT]]></title><description><![CDATA[<p>Und genau da ist mein Problem. Es sollte HEX: CD bzw. DEZ: 205 rauskommen.<br />
Bei deinem Code kommt 406 raus.</p>
<p>Calc rechnet richtig wenn man die HEX eingibt und zusammenzählt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/440218</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/440218</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Mon, 19 Jan 2004 23:08:33 GMT</pubDate></item><item><title><![CDATA[Reply to Summe aus HEX-Werten on Mon, 19 Jan 2004 23:11:49 GMT]]></title><description><![CDATA[<p>Ernst gemeint? Du mußt das Ergebnis natürlich noch verkürzen:</p>
<pre><code class="language-cpp">BYTE b = LOBYTE(chksum);
</code></pre>
<p>Die Variable b enthält jetzt 0xCD (hoffe ich, hab's nicht kontrolliert).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/440219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/440219</guid><dc:creator><![CDATA[-King-]]></dc:creator><pubDate>Mon, 19 Jan 2004 23:11:49 GMT</pubDate></item><item><title><![CDATA[Reply to Summe aus HEX-Werten on Mon, 19 Jan 2004 23:20:08 GMT]]></title><description><![CDATA[<p>Super danke Funkt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/440223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/440223</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Mon, 19 Jan 2004 23:20:08 GMT</pubDate></item></channel></rss>