<?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[Frage zu std::basic_string]]></title><description><![CDATA[<p>ich habe eine Funktion, die so hier aussieht:</p>
<pre><code class="language-cpp">void String::set(const char* string, int slen)
{
  clear();

  if(string &amp;&amp; slen)
  {
    data   = new char[slen + 1];
    length = slen;
    memcpy(data, string, slen);
    data[length] = NULL;
  }
}
</code></pre>
<p>Mich interessiert, wie die vonn der td::basic_string heißt.<br />
Den eine set Methode gibt es da nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/157975/frage-zu-std-basic_string</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 11:28:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/157975.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 31 Aug 2006 09:49:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zu std::basic_string on Thu, 31 Aug 2006 09:49:09 GMT]]></title><description><![CDATA[<p>ich habe eine Funktion, die so hier aussieht:</p>
<pre><code class="language-cpp">void String::set(const char* string, int slen)
{
  clear();

  if(string &amp;&amp; slen)
  {
    data   = new char[slen + 1];
    length = slen;
    memcpy(data, string, slen);
    data[length] = NULL;
  }
}
</code></pre>
<p>Mich interessiert, wie die vonn der td::basic_string heißt.<br />
Den eine set Methode gibt es da nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1128210</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1128210</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Thu, 31 Aug 2006 09:49:09 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu std::basic_string on Thu, 31 Aug 2006 09:50:59 GMT]]></title><description><![CDATA[<p>Ähm,</p>
<p>die Frage ist irgendwie unklar. Eventuell meinst Du den operator= ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1128214</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1128214</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Thu, 31 Aug 2006 09:50:59 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu std::basic_string on Thu, 31 Aug 2006 09:51:26 GMT]]></title><description><![CDATA[<p>also... die heißt würde ich ma sagen substr</p>
<p>string a = &quot;123456789&quot;;<br />
string b = a.substr(0, 5);<br />
dann is in b 12345 drin, von zeichen 0 5 zeichen an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1128215</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1128215</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Thu, 31 Aug 2006 09:51:26 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu std::basic_string on Thu, 31 Aug 2006 09:54:08 GMT]]></title><description><![CDATA[<p>gut, substr</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1128221</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1128221</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Thu, 31 Aug 2006 09:54:08 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu std::basic_string on Thu, 31 Aug 2006 10:16:28 GMT]]></title><description><![CDATA[<p>Ich würde ja behaupten die String::set hat sehr wenig vom Charakter der substr Methode. Sie kopiert einen übergebenen Speicherbereich übergebener Länge in einen neuen Puffer innerhalb des Objekts.</p>
<pre><code class="language-cpp">basic_string&amp; assign(const value_type *ptr, size_type count);
</code></pre>
<p>...macht sowas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1128238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1128238</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Thu, 31 Aug 2006 10:16:28 GMT</pubDate></item></channel></rss>