<?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[Problem mit String in Datei schreiben.]]></title><description><![CDATA[<p>Hallo. Ich eine vermutlich einfach zu lösendes Problem.</p>
<p>Also folgendes Funktioniert:</p>
<pre><code class="language-cpp">FILE * pFile;
pFile = fopen (&quot;abc.txt&quot;,&quot;a+&quot;);
if (pFile!=NULL){
  fputs (&quot;test...&quot;,pFile);
  fclose (pFile);
}
</code></pre>
<p>Das hier nicht (Fehlermedung: cannot convert 'std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;' to 'const char*'):</p>
<pre><code class="language-cpp">string s = &quot;test...&quot;;
FILE * pFile;
pFile = fopen (&quot;abc.txt&quot;,&quot;a+&quot;);
if (pFile!=NULL){
  fputs (s,pFile);
  fclose (pFile);
}
</code></pre>
<p>Ich möchte aber den sting s in die datei schreiben.<br />
Wie stell ich das an?</p>
<p>Vielen Dank, das war es dann auch mit den nervigen Fragen.</p>
<p>mfg<br />
Fabian</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/127001/problem-mit-string-in-datei-schreiben</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 22:13:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/127001.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 Nov 2005 15:41:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit String in Datei schreiben. on Sun, 20 Nov 2005 15:41:51 GMT]]></title><description><![CDATA[<p>Hallo. Ich eine vermutlich einfach zu lösendes Problem.</p>
<p>Also folgendes Funktioniert:</p>
<pre><code class="language-cpp">FILE * pFile;
pFile = fopen (&quot;abc.txt&quot;,&quot;a+&quot;);
if (pFile!=NULL){
  fputs (&quot;test...&quot;,pFile);
  fclose (pFile);
}
</code></pre>
<p>Das hier nicht (Fehlermedung: cannot convert 'std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;' to 'const char*'):</p>
<pre><code class="language-cpp">string s = &quot;test...&quot;;
FILE * pFile;
pFile = fopen (&quot;abc.txt&quot;,&quot;a+&quot;);
if (pFile!=NULL){
  fputs (s,pFile);
  fclose (pFile);
}
</code></pre>
<p>Ich möchte aber den sting s in die datei schreiben.<br />
Wie stell ich das an?</p>
<p>Vielen Dank, das war es dann auch mit den nervigen Fragen.</p>
<p>mfg<br />
Fabian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/922347</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/922347</guid><dc:creator><![CDATA[faleX]]></dc:creator><pubDate>Sun, 20 Nov 2005 15:41:51 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit String in Datei schreiben. on Sun, 20 Nov 2005 15:47:14 GMT]]></title><description><![CDATA[<ol>
<li>C++ hat seine eigenen Funktionen zum Schreiben und Lesen</li>
<li><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-126871.html" rel="nofollow">Zieh dir das mal rein</a></li>
</ol>
<p>EDIT: Ansonsten findest du per Suche oder in der FAQ auch was zu dem Thema.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/922357</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/922357</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Sun, 20 Nov 2005 15:47:14 GMT</pubDate></item></channel></rss>