<?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[BinaryToHex]]></title><description><![CDATA[<p>Hi!<br />
Ich hab folgendes Problem.<br />
Ich habe einen String gegeben in dem BinäreDaten stecken.<br />
Also keine {1,0} Folge sondern die seltsamen Zeichen *g*.<br />
Dies hätte ich gerne wie ein HexEditor es ausgibt als HexString.<br />
Ich benutze VisualStudio7 und schreibe in C++!</p>
<p>Danke im Vorraus!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/147175/binarytohex</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 22:38:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147175.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 May 2006 21:11:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to BinaryToHex on Sun, 14 May 2006 21:11:58 GMT]]></title><description><![CDATA[<p>Hi!<br />
Ich hab folgendes Problem.<br />
Ich habe einen String gegeben in dem BinäreDaten stecken.<br />
Also keine {1,0} Folge sondern die seltsamen Zeichen *g*.<br />
Dies hätte ich gerne wie ein HexEditor es ausgibt als HexString.<br />
Ich benutze VisualStudio7 und schreibe in C++!</p>
<p>Danke im Vorraus!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057817</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057817</guid><dc:creator><![CDATA[Finkman]]></dc:creator><pubDate>Sun, 14 May 2006 21:11:58 GMT</pubDate></item><item><title><![CDATA[Reply to BinaryToHex on Sun, 14 May 2006 21:28:27 GMT]]></title><description><![CDATA[<p>was für selsame Zeichen stecken denn da drin? base64? Buchstabe / Zahlengemisch / also letztlich Ascii-Zeichen oder wie sieht das aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057822</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057822</guid><dc:creator><![CDATA[ST]]></dc:creator><pubDate>Sun, 14 May 2006 21:28:27 GMT</pubDate></item><item><title><![CDATA[Reply to BinaryToHex on Sun, 14 May 2006 23:46:25 GMT]]></title><description><![CDATA[<p>ich denk base64!<br />
Die Funtktion sollte das gleich oder ähnliches tun wie die PHP-Funktion<br />
<a href="http://de2.php.net/manual/de/function.bin2hex.php" rel="nofollow">bin2hex</a><br />
Danke im Vorraus</p>
<p>Als Hinweiß... wenn ich einen stantdart Hexeditor nehme und auf Hexadezimal anzeige gehe, dann sehe ich genau das was ich bräucht! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057835</guid><dc:creator><![CDATA[Finkman]]></dc:creator><pubDate>Sun, 14 May 2006 23:46:25 GMT</pubDate></item><item><title><![CDATA[Reply to BinaryToHex on Mon, 15 May 2006 06:06:29 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">static inline TCHAR ByteToHex(int c)
{
	return static_cast&lt;TCHAR&gt;((c&lt;10) ? (c)+_T('0') : (c)-10+_T('A'));		
}

void BinToString(PCVOID pData, PTSTR pszOut, int iLen)
{
    int	iPos=0;
    const BYTE *pszStr = (const BYTE *)pData;
    while (iLen--) 
    {
   	BYTE byte = *pszStr++;
    	BYTE uByte = (byte &amp; 0xF0) &gt;&gt; 4,
              lByte = byte &amp; 0xF;
	pszOut[iPos++] = ByteToHex(uByte);
	pszOut[iPos++] = ByteToHex(lByte);
    }
    pszOut[iPos] = '\0';
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1057862</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057862</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 15 May 2006 06:06:29 GMT</pubDate></item><item><title><![CDATA[Reply to BinaryToHex on Mon, 15 May 2006 10:50:02 GMT]]></title><description><![CDATA[<p>Danke für den Code!<br />
Allerdings bringt der kompiler nur Fehler.<br />
Hab nun folgendes:</p>
<pre><code class="language-cpp">static inline string ByteToHex(int c)
{
    return static_cast&lt;string&gt;((c&lt;10) ? (c)+_T('0') : (c)-10+_T('A'));       
}

void BinToString(unsigned char* pData, string* pszOut, int iLen)
{
    int    iPos=0;
    const BYTE *pszStr = (const BYTE *)pData;
    while (iLen--)
    {
       BYTE byte = *pszStr++;
        BYTE uByte = (byte &amp; 0xF0) &gt;&gt; 4,
              lByte = byte &amp; 0xF;
    pszOut[iPos++] = ByteToHex(uByte);
    pszOut[iPos++] = ByteToHex(lByte);
    }
    pszOut[iPos] = '\0';
}
</code></pre>
<p>wobei die Funktion ByteToHex den folgenden Fehler bringt:</p>
<blockquote>
<p>testLoggerObject.cpp(27) : error C3861: '_T': identifier not found, even with argument-dependent lookup<br />
testLoggerObject.cpp(27) : error C3861: '_T': identifier not found, even with argument-dependent lookup</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1058009</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058009</guid><dc:creator><![CDATA[Finkman]]></dc:creator><pubDate>Mon, 15 May 2006 10:50:02 GMT</pubDate></item><item><title><![CDATA[Reply to BinaryToHex on Mon, 15 May 2006 10:54:13 GMT]]></title><description><![CDATA[<p>Wenn du mit std::string arbeitest, benötigst du das _T()-Makro auch nicht wirklich <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="😉"
    /> Das dient dazu, eine Zeichenkonstante je nach Projekteinstellungen als ASCII oder UNICODE darzustellen.</p>
<p>(und statt &quot;string&quot; solltest du eher &quot;char&quot; verwenden)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058012</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058012</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 15 May 2006 10:54:13 GMT</pubDate></item><item><title><![CDATA[Reply to BinaryToHex on Mon, 15 May 2006 11:45:26 GMT]]></title><description><![CDATA[<p>wenn ich nun</p>
<pre><code>static inline TCHAR ByteToHex(int c)
{
    return static_cast&lt;TCHAR&gt;((c&lt;10) ? (c)+_T('0') : (c)-10+_T('A'));       
}

void BinToString(unsigned char* pData, string* pszOut, int iLen)
{
    int    iPos=0;
    const BYTE *pszStr = (const BYTE *)pData;
    while (iLen--)
    {
       BYTE byte = *pszStr++;
        BYTE uByte = (byte &amp; 0xF0) &gt;&gt; 4,
              lByte = byte &amp; 0xF;
    pszOut[iPos++] = ByteToHex(uByte);
    pszOut[iPos++] = ByteToHex(lByte);
    }
    pszOut[iPos] = '\0';
}
</code></pre>
<p>schreibe bekomme ich die gleiche fehlermeldung.<br />
aber... wie sähe das mit char aus?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058047</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058047</guid><dc:creator><![CDATA[Finkman]]></dc:creator><pubDate>Mon, 15 May 2006 11:45:26 GMT</pubDate></item><item><title><![CDATA[Reply to BinaryToHex on Mon, 15 May 2006 11:52:15 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">static inline char ByteToHex(int c)
{
    return static_cast&lt;char&gt;((c&lt;10) ? (c)+'0' : (c)-10+'A');       
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1058052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058052</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 15 May 2006 11:52:15 GMT</pubDate></item></channel></rss>