<?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[CString als Hex Wert in CString speichern ?]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich suche eine Möglichkeit, einen Text der in einem CString enthalten ist, als einen Hex Wert in einen anderen CString zu speichern !</p>
<p>Gibt es hierfür eine Möglichkeit ?</p>
<p>Danke Coolsero</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/169154/cstring-als-hex-wert-in-cstring-speichern</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 01:59:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/169154.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 02 Jan 2007 15:58:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CString als Hex Wert in CString speichern ? on Tue, 02 Jan 2007 15:58:35 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich suche eine Möglichkeit, einen Text der in einem CString enthalten ist, als einen Hex Wert in einen anderen CString zu speichern !</p>
<p>Gibt es hierfür eine Möglichkeit ?</p>
<p>Danke Coolsero</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1201249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201249</guid><dc:creator><![CDATA[Coolsero]]></dc:creator><pubDate>Tue, 02 Jan 2007 15:58:35 GMT</pubDate></item><item><title><![CDATA[Reply to CString als Hex Wert in CString speichern ? on Tue, 02 Jan 2007 16:32:34 GMT]]></title><description><![CDATA[<p>so wie aufgeführt wäre es eine möglichkeit. wenn der String aus mehreren zeichen besteht must du das halt in eine schleife packen</p>
<pre><code>int iHex=0;
	char szChar[2]=&quot;A&quot;;
	char szHex[3];

	iHex += szChar[0];//Zeichen A in Int wandeln A ist 65

	sprintf(szHex,&quot;%.02x&quot;,iHex);//Int in Hex wandeln 65 ist nun 41

	MessageBox(szHex);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1201282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201282</guid><dc:creator><![CDATA[LowFly]]></dc:creator><pubDate>Tue, 02 Jan 2007 16:32:34 GMT</pubDate></item><item><title><![CDATA[Reply to CString als Hex Wert in CString speichern ? on Wed, 03 Jan 2007 07:46:35 GMT]]></title><description><![CDATA[<p>Man kann auch ohne sprintf auskommen. Das ist natürlich dann auch etwas flinker.</p>
<pre><code class="language-cpp">static inline char ByteToHexA(int c)
{
    return static_cast&lt;char&gt;((c&lt;10) ? (c)+'0' : (c)-10+'A');	
}

void BinToString(PCVOID pData, PSTR pszOut, int iLen)
{
    // Durchlaufe den gesamten Bereich
    int	iPos=0;
    const BYTE *pszStr = (const BYTE *)pData;
    while (iLen--) 
    {
        // Lade das nächste Byte
        BYTE byte = *pszStr++;
        BYTE uByte = (byte &amp; 0xF0) &gt;&gt; 4,
             lByte = byte &amp; 0xF;
        pszOut[iPos++] = ByteToHexA(uByte);
        pszOut[iPos++] = ByteToHexA(lByte);
    }
    pszOut[iPos] = '\0';
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1201576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201576</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 03 Jan 2007 07:46:35 GMT</pubDate></item><item><title><![CDATA[Reply to CString als Hex Wert in CString speichern ? on Wed, 03 Jan 2007 09:21:52 GMT]]></title><description><![CDATA[<p>&lt;Korinthen kack&gt;<br />
Oder noch flinker (ca. 25% in der Debug Version):</p>
<pre><code>static inline char ByteToHexA2(int c)
{
    return &quot;0123456789ABCDEF&quot;[c];   
}
</code></pre>
<p>&lt;/Korinthen kack&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1201601</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201601</guid><dc:creator><![CDATA[jencas]]></dc:creator><pubDate>Wed, 03 Jan 2007 09:21:52 GMT</pubDate></item><item><title><![CDATA[Reply to CString als Hex Wert in CString speichern ? on Wed, 03 Jan 2007 09:38:42 GMT]]></title><description><![CDATA[<p>Jupp! Gute Idee!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1201642</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201642</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 03 Jan 2007 09:38:42 GMT</pubDate></item></channel></rss>