<?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[CString Problem]]></title><description><![CDATA[<p>Hallo,</p>
<p>kann mir jemand sagen warum ich statt Computername und Username zweimal den Usernamen ausgegeben bekomme?</p>
<pre><code class="language-cpp">CString strName1, strName2;
getComputername(strName1.GetBuffer(0)); //getComputername(char *zielstring)
getUsername(strName2.GetBuffer(0)); //getUsername(char *zielstring)
cout &lt;&lt; strName1.GetBuffer(0) &lt;&lt; endl;
cout &lt;&lt; strName2.GetBuffer(0) &lt;&lt; endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/119791/cstring-problem</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 00:18:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/119791.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Sep 2005 14:49:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CString Problem on Mon, 05 Sep 2005 14:49:19 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>kann mir jemand sagen warum ich statt Computername und Username zweimal den Usernamen ausgegeben bekomme?</p>
<pre><code class="language-cpp">CString strName1, strName2;
getComputername(strName1.GetBuffer(0)); //getComputername(char *zielstring)
getUsername(strName2.GetBuffer(0)); //getUsername(char *zielstring)
cout &lt;&lt; strName1.GetBuffer(0) &lt;&lt; endl;
cout &lt;&lt; strName2.GetBuffer(0) &lt;&lt; endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/865516</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/865516</guid><dc:creator><![CDATA[Geuse]]></dc:creator><pubDate>Mon, 05 Sep 2005 14:49:19 GMT</pubDate></item><item><title><![CDATA[Reply to CString Problem on Mon, 05 Sep 2005 17:08:39 GMT]]></title><description><![CDATA[<p>Wenn du GetBuffer mit 0 aufrufst reservierst du auch nichts.<br />
Würde es so machen</p>
<pre><code class="language-cpp">char buffer[100]; // keine ahnung wie gross
CString strName1, strName2;
getComputername(buffer); //getComputername(char *zielstring)
strName1=buffer;
getUsername(buffer); //getUsername(char *zielstring)
strName2=buffer;
cout &lt;&lt; (const char*)strName1 &lt;&lt; endl;
cout &lt;&lt; (const char*)strName2 &lt;&lt; endl;
</code></pre>
<p>Kurt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/865625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/865625</guid><dc:creator><![CDATA[ZuK]]></dc:creator><pubDate>Mon, 05 Sep 2005 17:08:39 GMT</pubDate></item><item><title><![CDATA[Reply to CString Problem on Tue, 06 Sep 2005 08:41:32 GMT]]></title><description><![CDATA[<p>Da wäre doch CString::GetBufferSetLength angebrachter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/865959</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/865959</guid><dc:creator><![CDATA[hehejo]]></dc:creator><pubDate>Tue, 06 Sep 2005 08:41:32 GMT</pubDate></item><item><title><![CDATA[Reply to CString Problem on Tue, 06 Sep 2005 09:08:02 GMT]]></title><description><![CDATA[<p>Danke euch beiden <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>hab es jetzt mit GetBufferSetLength gemacht...<br />
so spar ich mir das char buffer[] <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
daher...</p>
<pre><code class="language-cpp">CString strName1, strName2;
getComputername(strName1.GetBufferSetLength(10)); //getComputername(char *zielstring)
getUsername(strName2.GetBufferSetLength(10)); //getUsername(char *zielstring)
cout &lt;&lt; (const char*)strName1 &lt;&lt; endl;
cout &lt;&lt; (const char*)strName2 &lt;&lt; endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/865982</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/865982</guid><dc:creator><![CDATA[Geuse]]></dc:creator><pubDate>Tue, 06 Sep 2005 09:08:02 GMT</pubDate></item></channel></rss>