<?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[AnsiString mit ostringstream verketten (war: operator)]]></title><description><![CDATA[<p>Hallo,<br />
wie kann ich einen AnsiString an einen String und umgekehrt anhängen?</p>
<p>Danke in voraus!<br />
Gruß daniel</p>
<p><strong>Edit:</strong><br />
Bitte aussagekräftige Überschriften wählen. Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/124741/ansistring-mit-ostringstream-verketten-war-operator</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Jul 2026 23:17:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/124741.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 31 Oct 2005 08:34:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to AnsiString mit ostringstream verketten (war: operator) on Mon, 31 Oct 2005 09:45:38 GMT]]></title><description><![CDATA[<p>Hallo,<br />
wie kann ich einen AnsiString an einen String und umgekehrt anhängen?</p>
<p>Danke in voraus!<br />
Gruß daniel</p>
<p><strong>Edit:</strong><br />
Bitte aussagekräftige Überschriften wählen. Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/904297</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/904297</guid><dc:creator><![CDATA[daniel23]]></dc:creator><pubDate>Mon, 31 Oct 2005 09:45:38 GMT</pubDate></item><item><title><![CDATA[Reply to AnsiString mit ostringstream verketten (war: operator) on Mon, 31 Oct 2005 08:47:38 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>was verstehst du unter einen String? std::string? C-Style String?</p>
<pre><code class="language-cpp">AnsiString A_String;
std::string S_String;
char *C_String;

...
A_String = AString + S_String.c-str(); + C_String;
S_String = A_String.c_str();
strncat(C_String, A_String.c_str(), 10); // Max. 10 Teichen aus A_String an C_String anhängen
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/904302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/904302</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 31 Oct 2005 08:47:38 GMT</pubDate></item><item><title><![CDATA[Reply to AnsiString mit ostringstream verketten (war: operator) on Mon, 31 Oct 2005 09:08:46 GMT]]></title><description><![CDATA[<p>danke!</p>
<p>Aber ich will AnsiString + ( setfill('0') +setw(4) ) vom Typ ostringstream +<br />
i=for-Schleife + AnsiString in einen AnsiString zwischenspeichern.<br />
Will nämlich in der VCL(BCB6) eine Schleife die von 0000 -9999 hoch zählt,aber angefangen eben bei 0000...0010...0100 also immer eine Null weg und da habe ich mehrere Editfelder die angehängt werden müssen.<br />
Ich hoffe jemand kann mir helfen.<br />
Gruß daniel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/904315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/904315</guid><dc:creator><![CDATA[daniel23]]></dc:creator><pubDate>Mon, 31 Oct 2005 09:08:46 GMT</pubDate></item><item><title><![CDATA[Reply to AnsiString mit ostringstream verketten (war: operator) on Mon, 31 Oct 2005 09:22:17 GMT]]></title><description><![CDATA[<p>Hallo</p>
<blockquote>
<p>Aber ich will AnsiString + ( setfill('0') +setw(4) ) vom Typ ostringstream +<br />
i=for-Schleife + AnsiString in einen AnsiString zwischenspeichern.</p>
</blockquote>
<p>Verstehe ich nicht. was ist setfill und setw? was hat ostringstream damit zu tun?<br />
Zeig doch mal einen passenden Codeausschnitt, mit allen Deklarationen.</p>
<p>Ich kann dir nur sagen, das du auch von AnsiString nach ostringstream in beide Richtungen mit der jeweiligen Methode c_str() bzw str() konvertieren kannst.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/904321</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/904321</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 31 Oct 2005 09:22:17 GMT</pubDate></item><item><title><![CDATA[Reply to AnsiString mit ostringstream verketten (war: operator) on Mon, 31 Oct 2005 09:53:07 GMT]]></title><description><![CDATA[<p>for(int i=0;i&lt;10000;i++)<br />
{<br />
ostringstream nummer;</p>
<p>nummer&lt;&lt;&quot; Hallo&quot;&lt;&lt;setfill('0')&lt;&lt;setw(4)&lt;&lt;i;</p>
<p>cout&lt;&lt;nummer.str();<br />
}// so sollte es am Ende Aussehen, aber eben nur in der VCL, also Anstatt &quot;Hallo&quot; eben Edit1-&gt;Text dann die Nullen(Schleife) und das ganze in einem AnsiString zwischengespeichert<br />
verstehste ich komm da nicht weiter,<br />
Und wenn ich nummer.str() in einem AnsiString speichern will(AnsiString a; a=nummer.str();) bekommme ich eine Fehlermeldung (Keine Übereinstimmung für AnsiString::operator=(string) gefunden<br />
Gruß daniel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/904339</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/904339</guid><dc:creator><![CDATA[daniel23]]></dc:creator><pubDate>Mon, 31 Oct 2005 09:53:07 GMT</pubDate></item><item><title><![CDATA[Reply to AnsiString mit ostringstream verketten (war: operator) on Mon, 31 Oct 2005 10:09:57 GMT]]></title><description><![CDATA[<p>Hallo</p>
<pre><code class="language-cpp">nummer&lt;&lt;Edit1-&gt;Text.c_str()&lt;&lt;setfill('0')&lt;&lt;setw(4)&lt;&lt;i;
</code></pre>
<p>Wobei ich mich allerdings frage, warum du VCL (TEdit) und Konsole (cout) mixen willst.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/904352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/904352</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 31 Oct 2005 10:09:57 GMT</pubDate></item><item><title><![CDATA[Reply to AnsiString mit ostringstream verketten (war: operator) on Mon, 31 Oct 2005 10:15:00 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::string stdstr = nummer.str();
AnsiString astr = stdstr.c_str();
// oder gleich
AnsiString astr = (nummer.str()).c_str();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/904354</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/904354</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Mon, 31 Oct 2005 10:15:00 GMT</pubDate></item><item><title><![CDATA[Reply to AnsiString mit ostringstream verketten (war: operator) on Mon, 31 Oct 2005 10:28:42 GMT]]></title><description><![CDATA[<p>Ich Danke euch wie verückt es funzt!!! <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>
<p>Gruß daniel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/904369</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/904369</guid><dc:creator><![CDATA[daniel23]]></dc:creator><pubDate>Mon, 31 Oct 2005 10:28:42 GMT</pubDate></item></channel></rss>