<?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[Hex to Text bzw string]]></title><description><![CDATA[<p>hey @ all</p>
<p>also ich hab grad ma im internet geschaut und hab folgendes gefunden:</p>
<pre><code>int main()
 {
 std::string name;
 cin&gt;&gt;name;

  string text = name;
  cout &lt;&lt; hex &lt;&lt; showbase;
  copy(text.begin(), text.end(),
  ostream_iterator&lt;int&gt;(cout, &quot; &quot;));
  cout &lt;&lt; endl;
getch();

}
</code></pre>
<p>geb ich jetzt bei name= hallo ein<br />
kommt</p>
<p>0x68 0x61 0x6c 0x6c 0x6f</p>
<p>jetzt müsste ich doch das auch wida umwandeln können oder?</p>
<pre><code>name = string text ;
  cout &lt;&lt; string &lt;&lt; showbase;
  copy(text.begin(), text.end(),
  ostream_iterator&lt;int&gt;(cout, &quot; &quot;));
  cout &lt;&lt; endl;
</code></pre>
<p>aber das funktioniert nicht:(</p>
<p>oder geht das anders??</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/202510/hex-to-text-bzw-string</link><generator>RSS for Node</generator><lastBuildDate>Tue, 06 Oct 2026 18:06:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/202510.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 12 Jan 2008 11:55:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hex to Text bzw string on Sat, 12 Jan 2008 11:55:31 GMT]]></title><description><![CDATA[<p>hey @ all</p>
<p>also ich hab grad ma im internet geschaut und hab folgendes gefunden:</p>
<pre><code>int main()
 {
 std::string name;
 cin&gt;&gt;name;

  string text = name;
  cout &lt;&lt; hex &lt;&lt; showbase;
  copy(text.begin(), text.end(),
  ostream_iterator&lt;int&gt;(cout, &quot; &quot;));
  cout &lt;&lt; endl;
getch();

}
</code></pre>
<p>geb ich jetzt bei name= hallo ein<br />
kommt</p>
<p>0x68 0x61 0x6c 0x6c 0x6f</p>
<p>jetzt müsste ich doch das auch wida umwandeln können oder?</p>
<pre><code>name = string text ;
  cout &lt;&lt; string &lt;&lt; showbase;
  copy(text.begin(), text.end(),
  ostream_iterator&lt;int&gt;(cout, &quot; &quot;));
  cout &lt;&lt; endl;
</code></pre>
<p>aber das funktioniert nicht:(</p>
<p>oder geht das anders??</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1435328</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1435328</guid><dc:creator><![CDATA[MasterTobi]]></dc:creator><pubDate>Sat, 12 Jan 2008 11:55:31 GMT</pubDate></item><item><title><![CDATA[Reply to Hex to Text bzw string on Sun, 13 Jan 2008 12:23:56 GMT]]></title><description><![CDATA[<p>Zum Zurückwandeln benötigst du einen istringstream:</p>
<pre><code class="language-cpp">istringstream istr(text);
istringstream eos;
char c; // evtl. int
while(istr != eos)
{
  istr &gt;&gt; hex &gt;&gt; showbase;
  istr &gt;&gt; c;
  cout &lt;&lt; c; // evtl. static_cast&lt;char&gt;(c);
}
</code></pre>
<p>[ungetestet]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1435835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1435835</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Sun, 13 Jan 2008 12:23:56 GMT</pubDate></item></channel></rss>