<?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[Datei Öffnen]]></title><description><![CDATA[<p>Hallo,<br />
in meinem C++ Buch steht folgendes:</p>
<pre><code class="language-cpp">ifstream quelle;
string quelldateiname;
cin&gt;&gt;quelldateiname;
quelle.open(quelldateiname.c_str(), ios::binary||ios::in);
...
string zieldateiname;
cin &gt;&gt; zieldateiname;
ofstream ziel(zieldateiname..c_str(), ios::binary||ios::in);
...
</code></pre>
<p>Wieso steht bei dem ziel stream kein .open? Heißt das, dass die Datei erzeugt wird? Und was passiert, wenn man eine Datei angibt, die schon existiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/258204/datei-öffnen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 12:06:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/258204.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Jan 2010 17:44:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei Öffnen on Thu, 07 Jan 2010 17:44:18 GMT]]></title><description><![CDATA[<p>Hallo,<br />
in meinem C++ Buch steht folgendes:</p>
<pre><code class="language-cpp">ifstream quelle;
string quelldateiname;
cin&gt;&gt;quelldateiname;
quelle.open(quelldateiname.c_str(), ios::binary||ios::in);
...
string zieldateiname;
cin &gt;&gt; zieldateiname;
ofstream ziel(zieldateiname..c_str(), ios::binary||ios::in);
...
</code></pre>
<p>Wieso steht bei dem ziel stream kein .open? Heißt das, dass die Datei erzeugt wird? Und was passiert, wenn man eine Datei angibt, die schon existiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834575</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834575</guid><dc:creator><![CDATA[Öffner]]></dc:creator><pubDate>Thu, 07 Jan 2010 17:44:18 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Öffnen on Thu, 07 Jan 2010 17:56:49 GMT]]></title><description><![CDATA[<p>Weil die Datei im Konstruktor von ostream steht. Wenn eine Datei existiert, wird sie überschrieben. Willst du neuen Text an den existierenden Text der Datei anhängen, musst du ios::app nehmen.<br />
Liege ich richtig in der Annahme, das &quot;ios::binary||ios::in&quot; falschen Syntax enthält und durch &quot;ios::binary | ios::in&quot; ersetzt werden müsste?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834580</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834580</guid><dc:creator><![CDATA[freaky]]></dc:creator><pubDate>Thu, 07 Jan 2010 17:56:49 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Öffnen on Thu, 07 Jan 2010 18:02:53 GMT]]></title><description><![CDATA[<p>Und wieso kann man das .open einfach weglassen. || war ein Tippfehler von mir im Buch steht|</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834584</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834584</guid><dc:creator><![CDATA[Öffner]]></dc:creator><pubDate>Thu, 07 Jan 2010 18:02:53 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Öffnen on Thu, 07 Jan 2010 18:04:54 GMT]]></title><description><![CDATA[<p>Öffner schrieb:</p>
<blockquote>
<p>Und wieso kann man das .open einfach weglassen. || war ein Tippfehler von mir im Buch steht|</p>
</blockquote>
<p>Hat er dir im ersten Satz beantwortet <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="😉"
    /> Wenn du die open-parameter beim Konstruktor angibst öffnet der die Datei.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834589</guid><dc:creator><![CDATA[evilissimo]]></dc:creator><pubDate>Thu, 07 Jan 2010 18:04:54 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Öffnen on Thu, 07 Jan 2010 18:18:45 GMT]]></title><description><![CDATA[<p>Ah ok also hätte man auch:</p>
<pre><code class="language-cpp">quelle(quelldateiname.c_str(), ios::binary||ios::in);
</code></pre>
<p>schreiben können.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834599</guid><dc:creator><![CDATA[Öffner]]></dc:creator><pubDate>Thu, 07 Jan 2010 18:18:45 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Öffnen on Thu, 07 Jan 2010 18:22:09 GMT]]></title><description><![CDATA[<p>Ja, aber immernoch dem Datentyp &quot;ifstream&quot; und einem | (Bit-Oder) anstatt zwei (Logischer Oder operator).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834601</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834601</guid><dc:creator><![CDATA[LeggaLasagne]]></dc:creator><pubDate>Thu, 07 Jan 2010 18:22:09 GMT</pubDate></item></channel></rss>