<?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[zwei werte in string zusammenfassen]]></title><description><![CDATA[<p>Hi,</p>
<p>hab ein problem beim zusammenfassen zweier werte in einem string.</p>
<pre><code class="language-cpp">string x = typeid(S).name() + IntToStr(&amp;matNr).c_str();
</code></pre>
<p>er bleibt immer an dem + hängen, ich weiss aber nicht wie ich sonst das um zusammenfassen kann ausser über mehrere string variablen und diese dann zusammenfassen. Einzeln geht es aber anders halt ncith.</p>
<p>Bitte helft mir.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/101142/zwei-werte-in-string-zusammenfassen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Jul 2026 13:39:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/101142.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 13 Feb 2005 18:22:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to zwei werte in string zusammenfassen on Sun, 13 Feb 2005 18:22:11 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>hab ein problem beim zusammenfassen zweier werte in einem string.</p>
<pre><code class="language-cpp">string x = typeid(S).name() + IntToStr(&amp;matNr).c_str();
</code></pre>
<p>er bleibt immer an dem + hängen, ich weiss aber nicht wie ich sonst das um zusammenfassen kann ausser über mehrere string variablen und diese dann zusammenfassen. Einzeln geht es aber anders halt ncith.</p>
<p>Bitte helft mir.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722409</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722409</guid><dc:creator><![CDATA[problem]]></dc:creator><pubDate>Sun, 13 Feb 2005 18:22:11 GMT</pubDate></item><item><title><![CDATA[Reply to zwei werte in string zusammenfassen on Sun, 13 Feb 2005 18:49:04 GMT]]></title><description><![CDATA[<p>warum machste IntToStr(&amp;matNr).c_str() ? lass doch einfach das .c_str() weg. da wandelst du doch den AnsiString in ein char* um. das kannste dann nich so &quot;Addieren&quot; wie AnsiStrings.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722428</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722428</guid><dc:creator><![CDATA[tuxman]]></dc:creator><pubDate>Sun, 13 Feb 2005 18:49:04 GMT</pubDate></item><item><title><![CDATA[Reply to zwei werte in string zusammenfassen on Sun, 13 Feb 2005 19:18:38 GMT]]></title><description><![CDATA[<p>auch ohne das c_str() funktioniert es nicht.</p>
<p>er meckert immer nur an dem + rum -&gt;</p>
<p>&quot;Konvertierung von 'AnsiString' nach 'String' nicht möglich&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722457</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722457</guid><dc:creator><![CDATA[problem]]></dc:creator><pubDate>Sun, 13 Feb 2005 19:18:38 GMT</pubDate></item><item><title><![CDATA[Reply to zwei werte in string zusammenfassen on Sun, 13 Feb 2005 19:30:22 GMT]]></title><description><![CDATA[<p>haste string in deinem Programm auch klein geschrieben? das muss schon groß denk' ich</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722476</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722476</guid><dc:creator><![CDATA[tuxman]]></dc:creator><pubDate>Sun, 13 Feb 2005 19:30:22 GMT</pubDate></item><item><title><![CDATA[Reply to zwei werte in string zusammenfassen on Sun, 13 Feb 2005 19:31:29 GMT]]></title><description><![CDATA[<p>typeid(...).name() gibt einen char-Pointer zurück. Also musst du das erst in (Ansi)String umwandeln:</p>
<pre><code class="language-cpp">String x = String(typeid(c).name()) + IntToStr(&amp;matNr);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/722478</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722478</guid><dc:creator><![CDATA[Dasd]]></dc:creator><pubDate>Sun, 13 Feb 2005 19:31:29 GMT</pubDate></item><item><title><![CDATA[Reply to zwei werte in string zusammenfassen on Sun, 13 Feb 2005 21:16:40 GMT]]></title><description><![CDATA[<p>ich weiss auch ncith mehr weiter, so geht es auch nicht...</p>
<p>das komische ist das , dass</p>
<pre><code class="language-cpp">string x = &quot;   &quot; + string(typeid(S).name()) + &quot;  &quot; ;
</code></pre>
<p>geht. Aber das</p>
<pre><code class="language-cpp">string x = &quot;   &quot; + string(typeid(S).name()) + &quot;  &quot; + IntToStr(matNr);
</code></pre>
<p>nicht. Ich weiss das hier wieder string klein ist aber es hängt ja anscheint nicht daran..<br />
Mitlerweile sagt er das, dass operator+ nicht für AnsiString wäre.<br />
kann ich das IntToStr noch anders machen??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722574</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722574</guid><dc:creator><![CDATA[problem]]></dc:creator><pubDate>Sun, 13 Feb 2005 21:16:40 GMT</pubDate></item><item><title><![CDATA[Reply to zwei werte in string zusammenfassen on Sun, 13 Feb 2005 22:18:13 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>also noch einmal : es gibt einen Unterschied zwischen string (std::string) und String (AnsiString). C++ ist case-sensitive!<br />
IntToStr() liefert einen (Ansi)String. Die Umwandlung zwischen beiden Typen erfolgt mit .c_str().</p>
<pre><code class="language-cpp">string x = &quot;   &quot; + string(typeid(S).name()) + &quot;  &quot; + IntToStr(matNr).c_str();
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722619</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722619</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 13 Feb 2005 22:18:13 GMT</pubDate></item><item><title><![CDATA[Reply to zwei werte in string zusammenfassen on Mon, 14 Feb 2005 08:23:50 GMT]]></title><description><![CDATA[<blockquote>
<p>Die Umwandlung zwischen beiden Typen erfolgt mit .c_str().</p>
</blockquote>
<p>Mit <strong>.c_str()</strong> hast du jetzt aber erstmal einen <strong>const char</strong>*, den du dann noch entsprechend in den gewünschten Typ umwandeln musst. Also würde es dann heißen:</p>
<p>[cpp]string x = &quot; &quot; + <strong>string</strong>(typeid(S).name()) + &quot; &quot; + string(IntToStr(matNr).c_str());[/cpp]<br />
So müsste es jedenfalls klappen.</p>
<p>der oli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722745</guid><dc:creator><![CDATA[der oli]]></dc:creator><pubDate>Mon, 14 Feb 2005 08:23:50 GMT</pubDate></item><item><title><![CDATA[Reply to zwei werte in string zusammenfassen on Mon, 14 Feb 2005 08:49:14 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>@der Oli : Wenn du meinen Code mal ausprobiert hättest, hättest du gemerkt, das er sehr wohl funktioniert.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722765</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 14 Feb 2005 08:49:14 GMT</pubDate></item></channel></rss>