<?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[Daten in .txt Datei exportieren]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich will ein kleines Programm programmieren, wo ich eingeben kann, z.b. &quot;Team A gewinnt gegen Team B&quot;. Und diese Angabe soll das Programm in eine .txt Datei speichern. Die es selber erstellen sollte (Also das Programm erstellt selbst die .txt Datei). Hat da schon mal jemand Erfahrungen gemacht?</p>
<p>mfg</p>
<p>Siggi</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/240170/daten-in-txt-datei-exportieren</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 04:49:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/240170.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 03 May 2009 07:48:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Daten in .txt Datei exportieren on Sun, 03 May 2009 07:48:03 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich will ein kleines Programm programmieren, wo ich eingeben kann, z.b. &quot;Team A gewinnt gegen Team B&quot;. Und diese Angabe soll das Programm in eine .txt Datei speichern. Die es selber erstellen sollte (Also das Programm erstellt selbst die .txt Datei). Hat da schon mal jemand Erfahrungen gemacht?</p>
<p>mfg</p>
<p>Siggi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704668</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704668</guid><dc:creator><![CDATA[Siggi32]]></dc:creator><pubDate>Sun, 03 May 2009 07:48:03 GMT</pubDate></item><item><title><![CDATA[Reply to Daten in .txt Datei exportieren on Sun, 03 May 2009 08:41:02 GMT]]></title><description><![CDATA[<p>schau mal im Buch/Tutorial/Referen deiner Wahl nach fstreams.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704680</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704680</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Sun, 03 May 2009 08:41:02 GMT</pubDate></item><item><title><![CDATA[Reply to Daten in .txt Datei exportieren on Sun, 03 May 2009 10:19:04 GMT]]></title><description><![CDATA[<p><a href="http://www.cplusplus.com/reference/iostream/cin/" rel="nofollow">std::cin</a><br />
<a href="http://www.cplusplus.com/reference/iostream/ofstream/" rel="nofollow">std::ofstream</a></p>
<p>Mehr braucht es dafür nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704717</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sun, 03 May 2009 10:19:04 GMT</pubDate></item><item><title><![CDATA[Reply to Daten in .txt Datei exportieren on Sun, 03 May 2009 13:50:56 GMT]]></title><description><![CDATA[<p>Hi,<br />
hier mal ein kleines Codebeispiel für fstream:</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
#include&lt;fstream&gt;
using namespace std;

int main()
{
ofstream myfile(/*hier Dateipfad einfügen*/);//öffnen

if(/*Gruppe A gewinnt*/)
{
	myfile&lt;&lt;&quot;Gruppe A gewinnt&quot;;
}
else//wenn B gewinnt
{

	myfile&lt;&lt;&quot;Gruppe B gewinnt&quot;;
}
myfile.close();//schließt die textdatei
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1704832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704832</guid><dc:creator><![CDATA[andi01]]></dc:creator><pubDate>Sun, 03 May 2009 13:50:56 GMT</pubDate></item><item><title><![CDATA[Reply to Daten in .txt Datei exportieren on Sun, 03 May 2009 15:10:52 GMT]]></title><description><![CDATA[<p>Vielleicht kann dir folgender Codeausschnitt helfen <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>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
using namespace std;

int main()
{
	ofstream ausgabeDatei;
	string test;
	test=&quot;blabla blubberblubber fasel&quot;;

	//Datei zum schreiben öffnen
	ausgabeDatei.open(&quot;test.txt&quot;,ios_base::out);
	if(ausgabeDatei)
	{
		ausgabeDatei&lt;&lt;test&lt;&lt;endl;
	}
	else
	{
		cerr&lt;&lt;&quot;Fehler beim Oeffnen der Datei!&quot;&lt;&lt;endl;
		exit(0);
	}	
	ausgabeDatei.close();

	ifstream eingabeDatei;

	//Datei zum Lesen öffnen
	eingabeDatei.open(&quot;test.txt&quot;,ios_base::out);
	if(eingabeDatei)
	{
	char zeichen;
		while(!eingabeDatei.eof())
		{
			eingabeDatei.get(zeichen);
			cout&lt;&lt;zeichen;
		}
	}
	else
	{
		cerr&lt;&lt;&quot;Fehler beim Oeffnen der Datei!&quot;&lt;&lt;endl;
		exit(0);
	}
	eingabeDatei.close();
	cin.get();
	return 0;

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1704856</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704856</guid><dc:creator><![CDATA[Realist]]></dc:creator><pubDate>Sun, 03 May 2009 15:10:52 GMT</pubDate></item><item><title><![CDATA[Reply to Daten in .txt Datei exportieren on Sun, 03 May 2009 15:19:47 GMT]]></title><description><![CDATA[<p>Wenn die datei, die bei .open geöffnet wird noch nicht existiert, wird sie automatisch neu angelegt!<br />
also einfach einen der obigen Codeausschnitte verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704862</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704862</guid><dc:creator><![CDATA[andi01]]></dc:creator><pubDate>Sun, 03 May 2009 15:19:47 GMT</pubDate></item><item><title><![CDATA[Reply to Daten in .txt Datei exportieren on Sun, 03 May 2009 15:29:13 GMT]]></title><description><![CDATA[<p>gleiches programm, anderer stil zum noch-mehr-alternativen-haben.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
using namespace std;

int main()
{
	{
		//Datei zum schreiben anlegen
		ofstream ausgabeDatei(&quot;test.txt&quot;);
		if(!ausgabeDatei)
		{
			cerr&lt;&lt;&quot;Fehler beim Oeffnen der Datei!&quot;&lt;&lt;'\n';
			return 1;
		}	
		string test=&quot;blabla blubberblubber fasel&quot;;
		ausgabeDatei&lt;&lt;test&lt;&lt;endl;
	}

	{
		//Datei zum Lesen anlegen
		ifstream eingabeDatei(&quot;test.txt&quot;);

		if(!eingabeDatei)
		{
			cerr&lt;&lt;&quot;Fehler beim Oeffnen der Datei!&quot;&lt;&lt;'\n';
			return 1;
		}
		char zeichen;
		while(eingabeDatei.get(zeichen))
		{
			cout&lt;&lt;zeichen;
		}
	}

	cin.get();
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1704866</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704866</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 03 May 2009 15:29:13 GMT</pubDate></item><item><title><![CDATA[Reply to Daten in .txt Datei exportieren on Sun, 03 May 2009 16:50:02 GMT]]></title><description><![CDATA[<p>Danke für die vielen Beispiele <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /><br />
Hat mir shr geholfen.</p>
<p>mfg</p>
<p>Siggi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704906</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704906</guid><dc:creator><![CDATA[Siggi32]]></dc:creator><pubDate>Sun, 03 May 2009 16:50:02 GMT</pubDate></item></channel></rss>