<?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[Inhalt von Datei]]></title><description><![CDATA[<p>Hi,</p>
<p>wie kann ich den Inhalt einer Datei löschen, ohne die Datei selber zu löschen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/167459/inhalt-von-datei</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 23:38:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/167459.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Dec 2006 12:14:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Inhalt von Datei on Mon, 11 Dec 2006 12:14:30 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>wie kann ich den Inhalt einer Datei löschen, ohne die Datei selber zu löschen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1190046</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1190046</guid><dc:creator><![CDATA[KingV1k]]></dc:creator><pubDate>Mon, 11 Dec 2006 12:14:30 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von Datei on Mon, 11 Dec 2006 12:17:07 GMT]]></title><description><![CDATA[<p>indem du die Datei mit ios::trunc öffnest (bzw. &quot;w&quot;), wird der bisherige Inhalt gelöscht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1190050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1190050</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 11 Dec 2006 12:17:07 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von Datei on Mon, 11 Dec 2006 14:15:29 GMT]]></title><description><![CDATA[<p>ios::trunc funktioniert bei mir nicht. Wenn ich es benutze erhalte ich bloß eine Ausgabe in welcher &quot;Klappt nicht.&quot; steht. Daraus schließe ich er hat Probleme die Datei zu öffnen. und es liegt nicht daran das die Datei nicht existiert. Was denkt ihr woran es liegt?</p>
<pre><code>fstream testopen;
		string diesername = path_folder + &quot;ACLIENT.INP&quot;; //absoluter Pfad
		testopen.open(diesername.c_str(), ios::trunc);
		if(!testopen)
		{
			cout&lt;&lt;&quot;Klappt nicht.&quot;&lt;&lt;endl;
		}
		else
		{
			testopen&lt;&lt;old_ACLIENT_INP;
		}
		testopen.close();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1190135</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1190135</guid><dc:creator><![CDATA[KingV1k]]></dc:creator><pubDate>Mon, 11 Dec 2006 14:15:29 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von Datei on Mon, 11 Dec 2006 16:18:53 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">testopen.open(diesername.c_str(), ios::out | ios::trunc);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1190221</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1190221</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 11 Dec 2006 16:18:53 GMT</pubDate></item></channel></rss>