<?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 nach char*]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine Frage zu folgendem funktionierenden Code:</p>
<p>char buffer[16];<br />
char* ppuffer=buffer;<br />
CString str(&quot;Alex&quot;);<br />
ppuffer=str;</p>
<p>Innerhalb von CSimpleStringT oder CStringT ist kein Umwandlungsoperator &quot;CString-&gt; char*&quot; definiert (operator char*()). Wie funktioniert es trotzdem?</p>
<p>Danke für Eure Hilfe</p>
<p>Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/158423/cstring-nach-char</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Jul 2026 11:33:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/158423.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 05 Sep 2006 09:51:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CString nach char* on Tue, 05 Sep 2006 09:51:16 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine Frage zu folgendem funktionierenden Code:</p>
<p>char buffer[16];<br />
char* ppuffer=buffer;<br />
CString str(&quot;Alex&quot;);<br />
ppuffer=str;</p>
<p>Innerhalb von CSimpleStringT oder CStringT ist kein Umwandlungsoperator &quot;CString-&gt; char*&quot; definiert (operator char*()). Wie funktioniert es trotzdem?</p>
<p>Danke für Eure Hilfe</p>
<p>Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1131361</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1131361</guid><dc:creator><![CDATA[Alexander Kricke]]></dc:creator><pubDate>Tue, 05 Sep 2006 09:51:16 GMT</pubDate></item><item><title><![CDATA[Reply to CString nach char* on Tue, 05 Sep 2006 10:31:52 GMT]]></title><description><![CDATA[<p>CString hat einen &quot;operator LPTSTR()&quot; (oder so ähnlich) - und das ist ein typedef für char* <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="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1131376</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1131376</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 05 Sep 2006 10:31:52 GMT</pubDate></item><item><title><![CDATA[Reply to CString nach char* on Tue, 05 Sep 2006 12:02:37 GMT]]></title><description><![CDATA[<p>CStoll schrieb:</p>
<blockquote>
<p>CString hat einen &quot;operator LPTSTR()&quot; (oder so ähnlich) - und das ist ein typedef für char* <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="😉"
    /></p>
</blockquote>
<p>LP<strong>T</strong>STR ist *kein* typedef für char* sondern für TCHAR*</p>
<p>Somit hängt es von den Compiler-Einstellungen für UNICODE ab, ob es char* oder wchar_t* ist.</p>
<p>@OP: Wenn Du schon MFC hast, dann verwende das CT2[C]A makro:</p>
<pre><code class="language-cpp">CString s(_T(&quot;hello world&quot;));
  char *pStr = CT2A(s);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1131440</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1131440</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 05 Sep 2006 12:02:37 GMT</pubDate></item></channel></rss>