<?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[Stringstream]]></title><description><![CDATA[<p>Hi..<br />
hab ein Problem mit stringstream! Ich möchte eine Int-Variable in eine String-Variable packen...mein Ansatz:</p>
<pre><code class="language-cpp">std::stringstream stream;
std::string TestString;
char TestChar;
int TestInt = 5;

TestChar = (char)TestInt;
std::cout &lt;&lt; TestChar &lt;&lt; std::endl;//funktioniert einwandfrei

stream &lt;&lt; TestChar;
stream &gt;&gt; TestString;

std::cout &lt;&lt; TestString &lt;&lt; std::endl;//gibt nichts aus...
</code></pre>
<p>compilen tuts mir das einwandfrei...<br />
Wenn ich die Integer jetzt immer erhöhe, dann gibt es mir seltsamerweise sowas hier aus:</p>
<pre><code>!
&quot;
§
$
%
//...
Q
W
E
R
//...
Z
</code></pre>
<p>Hilfe? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /><br />
Gruß,<br />
Finn</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/271514/stringstream</link><generator>RSS for Node</generator><lastBuildDate>Sat, 29 Aug 2026 11:19:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/271514.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Jul 2010 19:23:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Stringstream on Thu, 29 Jul 2010 19:23:07 GMT]]></title><description><![CDATA[<p>Hi..<br />
hab ein Problem mit stringstream! Ich möchte eine Int-Variable in eine String-Variable packen...mein Ansatz:</p>
<pre><code class="language-cpp">std::stringstream stream;
std::string TestString;
char TestChar;
int TestInt = 5;

TestChar = (char)TestInt;
std::cout &lt;&lt; TestChar &lt;&lt; std::endl;//funktioniert einwandfrei

stream &lt;&lt; TestChar;
stream &gt;&gt; TestString;

std::cout &lt;&lt; TestString &lt;&lt; std::endl;//gibt nichts aus...
</code></pre>
<p>compilen tuts mir das einwandfrei...<br />
Wenn ich die Integer jetzt immer erhöhe, dann gibt es mir seltsamerweise sowas hier aus:</p>
<pre><code>!
&quot;
§
$
%
//...
Q
W
E
R
//...
Z
</code></pre>
<p>Hilfe? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /><br />
Gruß,<br />
Finn</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1933706</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1933706</guid><dc:creator><![CDATA[Finn]]></dc:creator><pubDate>Thu, 29 Jul 2010 19:23:07 GMT</pubDate></item><item><title><![CDATA[Reply to Stringstream on Thu, 29 Jul 2010 19:26:13 GMT]]></title><description><![CDATA[<p>Naja. Schau mal in eine ASCII Tabelle. Stellst du was fest?</p>
<p>Aber warum denn nicht so?:</p>
<pre><code class="language-cpp">std::stringstream stream; 
std::string TestString; 
int TestInt = 5; 

std::cout &lt;&lt; TestInt &lt;&lt; std::endl;//funktioniert einwandfrei 

stream &lt;&lt; TestInt; 
stream &gt;&gt; TestString; 

std::cout &lt;&lt; TestString &lt;&lt; std::endl;//gibt nichts aus...
</code></pre>
<p>Dafür ist <code>std::stringstream</code> genau da. Dass du keine eigenen komischen Konvertierungen machen musst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1933708</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1933708</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Thu, 29 Jul 2010 19:26:13 GMT</pubDate></item><item><title><![CDATA[Reply to Stringstream on Thu, 29 Jul 2010 20:14:11 GMT]]></title><description><![CDATA[<p>Oh <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /><br />
Danke^^ Mal wieder Brainafk gewesen anscheinend <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1933719</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1933719</guid><dc:creator><![CDATA[Finn]]></dc:creator><pubDate>Thu, 29 Jul 2010 20:14:11 GMT</pubDate></item></channel></rss>