<?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[[STRING] Unterschied &amp;lt;&amp;lt; und append(str)]]></title><description><![CDATA[<p>Hallo,</p>
<p>Gibt es einen unterschied zw.:</p>
<pre><code class="language-cpp">str1 &lt;&lt; str2;
</code></pre>
<p>und</p>
<pre><code class="language-cpp">str1.append(str2);
</code></pre>
<p>ich weiß dass bei</p>
<pre><code>append
</code></pre>
<p>der string am Ende eingefügt wird, ist das bei</p>
<pre><code>&lt;&lt;
</code></pre>
<p>auch so?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/183151/string-unterschied-lt-lt-und-append-str</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 05:01:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/183151.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 02 Jun 2007 09:01:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 09:01:01 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Gibt es einen unterschied zw.:</p>
<pre><code class="language-cpp">str1 &lt;&lt; str2;
</code></pre>
<p>und</p>
<pre><code class="language-cpp">str1.append(str2);
</code></pre>
<p>ich weiß dass bei</p>
<pre><code>append
</code></pre>
<p>der string am Ende eingefügt wird, ist das bei</p>
<pre><code>&lt;&lt;
</code></pre>
<p>auch so?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297021</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297021</guid><dc:creator><![CDATA[String]]></dc:creator><pubDate>Sat, 02 Jun 2007 09:01:01 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 09:01:38 GMT]]></title><description><![CDATA[<p>das erste gibts überhaupt nicht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297023</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297023</guid><dc:creator><![CDATA[he?]]></dc:creator><pubDate>Sat, 02 Jun 2007 09:01:38 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 09:05:28 GMT]]></title><description><![CDATA[<p>Gut zu wissen hab ich wohl mit Datei eingabe verwechselt <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="😃"
    /><br />
aber: fügt</p>
<pre><code>append
</code></pre>
<p>vor dem einfügen des Strings ein Whitespace ein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297025</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297025</guid><dc:creator><![CDATA[String]]></dc:creator><pubDate>Sat, 02 Jun 2007 09:05:28 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 09:06:46 GMT]]></title><description><![CDATA[<p>Mir ist gerade eingefallen das ich es auch selbst ausprobieren könnte <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/1297026</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297026</guid><dc:creator><![CDATA[String]]></dc:creator><pubDate>Sat, 02 Jun 2007 09:06:46 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 09:08:27 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;

using namespace std;

int main( ) {

	string test( &quot;Hello&quot; );
	test.append( &quot;, &quot; );
	test.append( &quot;World!&quot; );

	cout &lt;&lt; test &lt;&lt; endl;
}
</code></pre>
<p>Kurz gesagt: nein.</p>
<p>greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297027</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297027</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Sat, 02 Jun 2007 09:08:27 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 09:13:15 GMT]]></title><description><![CDATA[<p>Was ist der unterschied zwischen</p>
<pre><code class="language-cpp">string txt = &quot;hallo &quot;;
txt+=&quot;welt&quot;

//und

string txt2 = &quot;hallo &quot;;
txt2.append(&quot;welt&quot;);
</code></pre>
<p>Das erste macht glaub ich nen neuen string.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297031</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297031</guid><dc:creator><![CDATA[DieFrageMüssteSein]]></dc:creator><pubDate>Sat, 02 Jun 2007 09:13:15 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 09:17:35 GMT]]></title><description><![CDATA[<p>Kein Unterschied.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297033</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Sat, 02 Jun 2007 09:17:35 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 09:33:33 GMT]]></title><description><![CDATA[<p>So da das nun geklärt ist stehe ich vor einem neuen Problem:</p>
<p>Wie kann ich eine ganze TXT file in einen String kopieren(die größe ist klein genug um in den String zu passen)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297038</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297038</guid><dc:creator><![CDATA[String]]></dc:creator><pubDate>Sat, 02 Jun 2007 09:33:33 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 09:34:25 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">_Myt&amp; operator+=(const _Elem *_Ptr)
		{	// append [_Ptr, &lt;null&gt;)
		return (append(_Ptr));
		}
</code></pre>
<p>+= ruft append auf, also spart man sich einen Aufruf, wenns nciht sowieso inline ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297039</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297039</guid><dc:creator><![CDATA[codegugger]]></dc:creator><pubDate>Sat, 02 Jun 2007 09:34:25 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 09:41:16 GMT]]></title><description><![CDATA[<p>String schrieb:</p>
<blockquote>
<p>So da das nun geklärt ist stehe ich vor einem neuen Problem:</p>
<p>Wie kann ich eine ganze TXT file in einen String kopieren(die größe ist klein genug um in den String zu passen)</p>
</blockquote>
<p>Dateigröße auslesen, Größe des Strings anpassen und einlesen (per read()). Oder Zeilenweise (getline()) einlesen und immer an den String anhängen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297041</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297041</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Sat, 02 Jun 2007 09:41:16 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 11:23:21 GMT]]></title><description><![CDATA[<p>David_pb schrieb:</p>
<blockquote>
<p>String schrieb:</p>
<blockquote>
<p>So da das nun geklärt ist stehe ich vor einem neuen Problem:</p>
<p>Wie kann ich eine ganze TXT file in einen String kopieren(die größe ist klein genug um in den String zu passen)</p>
</blockquote>
<p>Dateigröße auslesen, Größe des Strings anpassen und einlesen (per read()). Oder Zeilenweise (getline()) einlesen und immer an den String anhängen.</p>
</blockquote>
<p>und wie kann ich die Dateigröße bzw. die Zeichenanzahl in der Datei auslesen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297083</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297083</guid><dc:creator><![CDATA[String]]></dc:creator><pubDate>Sat, 02 Jun 2007 11:23:21 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 11:35:28 GMT]]></title><description><![CDATA[<p>Dateizeiger ans Ende der Datei setzten und die Position auslesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297087</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297087</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Sat, 02 Jun 2007 11:35:28 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 11:37:53 GMT]]></title><description><![CDATA[<p>String schrieb:</p>
<blockquote>
<p>So da das nun geklärt ist stehe ich vor einem neuen Problem:</p>
<p>Wie kann ich eine ganze TXT file in einen String kopieren(die größe ist klein genug um in den String zu passen)</p>
</blockquote>
<p><a href="http://c-plusplus.net/forum/viewtopic-var-p-is-1280471.html#1280471" rel="nofollow">http://c-plusplus.net/forum/viewtopic-var-p-is-1280471.html#1280471</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297088</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297088</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 02 Jun 2007 11:37:53 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 11:39:04 GMT]]></title><description><![CDATA[<p>Die String-Eingabe sorgt selber dafür, daß genug Platz reserviert wird, also brauchst du die Dateigröße auch nicht vorausberechnen - nimm einfach getline() und verkette die Strings dann immer miteinander:</p>
<pre><code class="language-cpp">ifstream file;
string filetext, line;
while(getline(file,line))
  filetext += line+'\n';
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1297090</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297090</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Sat, 02 Jun 2007 11:39:04 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 11:51:55 GMT]]></title><description><![CDATA[<p>getline hat als drittes argument, das Zeichen, mit dem die Zeile aufhört (normalerweise '\n'), welches nicht mit eingelesen wird. Dies kann man jederzeit durch in anderes ersetzen, beispielsweise, wenn man weiß, dass der gesamte text mit einem bestimmten zeichen aufhört.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297097</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297097</guid><dc:creator><![CDATA[Krux]]></dc:creator><pubDate>Sat, 02 Jun 2007 11:51:55 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Sat, 02 Jun 2007 13:34:33 GMT]]></title><description><![CDATA[<p>und wenn ich EOF als endezeichen verwende? oder geht das nicht weils kein char ist? aber ich glaube da gabs mal was à la std::ios_base::eof oder std::char_traits::eof oder so, kann das sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297146</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297146</guid><dc:creator><![CDATA[String]]></dc:creator><pubDate>Sat, 02 Jun 2007 13:34:33 GMT</pubDate></item><item><title><![CDATA[Reply to [STRING] Unterschied &amp;lt;&amp;lt; und append(str) on Mon, 04 Jun 2007 11:31:30 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::ifstream in(&quot;blah.txt&quot;);
std::istringstream s;
s &lt;&lt; in.rdbuf();
std::string dateiinhalt = s.str();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1298375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1298375</guid><dc:creator><![CDATA[tntnet]]></dc:creator><pubDate>Mon, 04 Jun 2007 11:31:30 GMT</pubDate></item></channel></rss>