<?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[Hexadezimal -&amp;gt; Dezimal -&amp;gt; ASCII2]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe da ein Problem, es würde mich sehr freuen, wenn mir jemand weiterhelfen könnte:</p>
<p><strong>Hier mein Vorhaben:</strong><br />
Ich habe eine 2 Byte große Zahl z.b. <strong>0x00ff</strong><br />
Diese Zahl (Desimal 255) soll dann in die 3 Ziffern zerlegt werden<br />
<strong>2-5-5</strong><br />
Die einzelnen Ziffern sollen dann in ASCII2-Zeichen umgewandelt werden<br />
(zweimal 0: 0x30 0x30) <strong>0x32 0x35 0x35</strong></p>
<p>Gibt es für solche Sachen Standardfunktionen?<br />
Oder wie stelle ich das am sinnvollsten an?</p>
<p>Gruß Tupo13</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/130231/hexadezimal-gt-dezimal-gt-ascii2</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 14:35:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/130231.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Dec 2005 06:42:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hexadezimal -&amp;gt; Dezimal -&amp;gt; ASCII2 on Wed, 21 Dec 2005 06:43:23 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe da ein Problem, es würde mich sehr freuen, wenn mir jemand weiterhelfen könnte:</p>
<p><strong>Hier mein Vorhaben:</strong><br />
Ich habe eine 2 Byte große Zahl z.b. <strong>0x00ff</strong><br />
Diese Zahl (Desimal 255) soll dann in die 3 Ziffern zerlegt werden<br />
<strong>2-5-5</strong><br />
Die einzelnen Ziffern sollen dann in ASCII2-Zeichen umgewandelt werden<br />
(zweimal 0: 0x30 0x30) <strong>0x32 0x35 0x35</strong></p>
<p>Gibt es für solche Sachen Standardfunktionen?<br />
Oder wie stelle ich das am sinnvollsten an?</p>
<p>Gruß Tupo13</p>
]]></description><link>https://www.c-plusplus.net/forum/post/946755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946755</guid><dc:creator><![CDATA[Tupo13]]></dc:creator><pubDate>Wed, 21 Dec 2005 06:43:23 GMT</pubDate></item><item><title><![CDATA[Reply to Hexadezimal -&amp;gt; Dezimal -&amp;gt; ASCII2 on Wed, 21 Dec 2005 07:09:36 GMT]]></title><description><![CDATA[<p>(s)printf <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/946762</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946762</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 21 Dec 2005 07:09:36 GMT</pubDate></item><item><title><![CDATA[Reply to Hexadezimal -&amp;gt; Dezimal -&amp;gt; ASCII2 on Wed, 21 Dec 2005 11:13:14 GMT]]></title><description><![CDATA[<p>@ CStoll</p>
<p>Danke für deine Antwort.<br />
Leider weiß ich nicht, wie das mit sprintf funktionieren soll, kannst du das bitte etwas genauer erklären?</p>
<p>Es ist ja jede einzelne Ziffer BCD kodiert und dann noch einmal ASCII kodiert.<br />
Beispiel:</p>
<p>Die Dezimalzahl 1234 will ich in einem 5 byte großen Char-Array als ASCII Zeichen speichern.<br />
als0 (0 1 2 3 4) in ASCII dann (30 31 32 33 34)</p>
<p>Momentan mache ich es so<br />
Ich dividiere die Zahl durch 10.000<br />
Das Ergebnis addiere ich mit 30 um das ASCII Zeichen zu erhalten<br />
Das ist dann der erste Wert meines Arrays</p>
<p>Den Rest (Modulo) dividiere ich durch 1.000<br />
Das Ergebnis addiere ich mit 30 um das ASCII Zeichen zu erhalten<br />
Das ist dann der 2. Wert</p>
<p>...............usw</p>
<p>Mich würde interressieren, ob jemand einen besseren, komfortableren Weg kennt?</p>
<p>Gruß Tupo13</p>
]]></description><link>https://www.c-plusplus.net/forum/post/946933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946933</guid><dc:creator><![CDATA[Tupo13]]></dc:creator><pubDate>Wed, 21 Dec 2005 11:13:14 GMT</pubDate></item><item><title><![CDATA[Reply to Hexadezimal -&amp;gt; Dezimal -&amp;gt; ASCII2 on Wed, 21 Dec 2005 11:28:14 GMT]]></title><description><![CDATA[<p>Du stellst zunächst ein entsprechend großes char-Array zur Verfügung, dann kannst du es mit sprintf() füllen (der macht das automatisch, was du von Hand erledigst):</p>
<pre><code class="language-cpp">char out[outsize];//outsize entsprechend groß wählen
int inp=1234;
sprintf(out,&quot;%i&quot;,inp);
</code></pre>
<p>(alternativ kannst du auch mal in der C++ FAQ zum Thema &quot;einmal Zahl und zurück&quot; nach weiteren Lösungsmöglichkeiten suchen)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/946942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946942</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 21 Dec 2005 11:28:14 GMT</pubDate></item></channel></rss>