<?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[von char to string]]></title><description><![CDATA[<p>Ich suche folgende operation / cast / umwandlung:</p>
<p>ich bekomme ein &quot;char *name&quot;</p>
<p>und möchte diesen Wert an eine Funktion fkt2(string *name2){}</p>
<p>weiterleiten.</p>
<p>wie komme ich von einem char* auf ein string*</p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/206579/von-char-to-string</link><generator>RSS for Node</generator><lastBuildDate>Sat, 10 Oct 2026 11:02:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/206579.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Feb 2008 15:06:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to von char to string on Tue, 26 Feb 2008 15:06:36 GMT]]></title><description><![CDATA[<p>Ich suche folgende operation / cast / umwandlung:</p>
<p>ich bekomme ein &quot;char *name&quot;</p>
<p>und möchte diesen Wert an eine Funktion fkt2(string *name2){}</p>
<p>weiterleiten.</p>
<p>wie komme ich von einem char* auf ein string*</p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463335</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463335</guid><dc:creator><![CDATA[von char to string]]></dc:creator><pubDate>Tue, 26 Feb 2008 15:06:36 GMT</pubDate></item><item><title><![CDATA[Reply to von char to string on Tue, 26 Feb 2008 15:08:53 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::string *p_str = new std::string(name);
fkt2(p_str);
delete p_str;
</code></pre>
<p>Oder:</p>
<pre><code class="language-cpp">std::string name2(name);
fkt2(&amp;name2);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1463341</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463341</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Tue, 26 Feb 2008 15:08:53 GMT</pubDate></item><item><title><![CDATA[Reply to von char to string on Tue, 26 Feb 2008 15:09:44 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::string str(name2);
fkt2(&amp;str);
</code></pre>
<p>pointer auf strings als funktionsargumente sind aber doof.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463344</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463344</guid><dc:creator><![CDATA[bin nicht er]]></dc:creator><pubDate>Tue, 26 Feb 2008 15:09:44 GMT</pubDate></item><item><title><![CDATA[Reply to von char to string on Tue, 26 Feb 2008 15:15:14 GMT]]></title><description><![CDATA[<p>Hmm einfach:</p>
<pre><code class="language-cpp">void fkt2(std::string const&amp; string);
</code></pre>
<p>... dann hast du so doofe Probleme nicht <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/1463350</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463350</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Tue, 26 Feb 2008 15:15:14 GMT</pubDate></item><item><title><![CDATA[Reply to von char to string on Tue, 26 Feb 2008 15:16:23 GMT]]></title><description><![CDATA[<p>von char to string schrieb:</p>
<blockquote>
<p>ich bekomme ein &quot;char *name&quot;</p>
<p>und möchte diesen Wert an eine Funktion fkt2(string *name2){}</p>
<p>weiterleiten.</p>
</blockquote>
<p>Grundsätzlich kann ich mich nur dem Vorposter anschließen. Warum arbeitet man bei der fkt2 mit einem Zeiger auf String (wäre an sich nur sinnvoll wenn NULL eine zulässige Übergabe ist, da Referenzen und Konstante Referenzen eigentlich üblicher und weniger Fehleranfällig sind)?</p>
<p>Zweite Anmerkung: ich hoffe die Funktion steht nicht so im Header (using namespace im Header sollte niemals gemacht werden).</p>
<p>cu André</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463355</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463355</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Tue, 26 Feb 2008 15:16:23 GMT</pubDate></item></channel></rss>