<?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[Dateioperationen...]]></title><description><![CDATA[<p>Hallo zusammen,<br />
ich habe ein Problem, ich habe ein Quellcode abgetippt aber das Funktioniert überhaupt nicht.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;

int main()
{
    ofstream outfile;

    outfile.open(&quot;test.txt&quot;,ios::out);
    outfile &lt;&lt; &quot;Das ist ein Test!&quot;&lt;&lt; endl;
    outfile.clode;
    return 0;
}
</code></pre>
<p>ich bekomme immmer diese Fehler:</p>
<pre><code>ompiler: Default compiler
Führt  g++.exe... aus
g++.exe &quot;C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp&quot; -o &quot;C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.exe&quot;    -I&quot;C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include&quot;  -I&quot;C:\Dev-Cpp\include\c++\3.4.2\backward&quot;  -I&quot;C:\Dev-Cpp\include\c++\3.4.2\mingw32&quot;  -I&quot;C:\Dev-Cpp\include\c++\3.4.2&quot;  -I&quot;C:\Dev-Cpp\include&quot;   -L&quot;C:\Dev-Cpp\lib&quot; 
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp: In function `int main()':
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:6: error: `ofstream' undeclared (first use this function)
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:6: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:6: error: expected `;' before &quot;outfile&quot;
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:8: error: `outfile' undeclared (first use this function)
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:8: error: `ios' has not been declared
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:8: error: `out' undeclared (first use this function)
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:9: error: `endl' undeclared (first use this function)

Ausführung beendet
</code></pre>
<p>vielleicht kann mir jemand sagen warum das nicht klappt ?</p>
<p>GRuß Timb0</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/194864/dateioperationen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 29 Sep 2026 17:00:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/194864.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Oct 2007 16:07:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dateioperationen... on Thu, 11 Oct 2007 16:07:30 GMT]]></title><description><![CDATA[<p>Hallo zusammen,<br />
ich habe ein Problem, ich habe ein Quellcode abgetippt aber das Funktioniert überhaupt nicht.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;

int main()
{
    ofstream outfile;

    outfile.open(&quot;test.txt&quot;,ios::out);
    outfile &lt;&lt; &quot;Das ist ein Test!&quot;&lt;&lt; endl;
    outfile.clode;
    return 0;
}
</code></pre>
<p>ich bekomme immmer diese Fehler:</p>
<pre><code>ompiler: Default compiler
Führt  g++.exe... aus
g++.exe &quot;C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp&quot; -o &quot;C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.exe&quot;    -I&quot;C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include&quot;  -I&quot;C:\Dev-Cpp\include\c++\3.4.2\backward&quot;  -I&quot;C:\Dev-Cpp\include\c++\3.4.2\mingw32&quot;  -I&quot;C:\Dev-Cpp\include\c++\3.4.2&quot;  -I&quot;C:\Dev-Cpp\include&quot;   -L&quot;C:\Dev-Cpp\lib&quot; 
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp: In function `int main()':
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:6: error: `ofstream' undeclared (first use this function)
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:6: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:6: error: expected `;' before &quot;outfile&quot;
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:8: error: `outfile' undeclared (first use this function)
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:8: error: `ios' has not been declared
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:8: error: `out' undeclared (first use this function)
C:\Dokumente und Einstellungen\Christine\Desktop\Neuer Ordner\file.cpp:9: error: `endl' undeclared (first use this function)

Ausführung beendet
</code></pre>
<p>vielleicht kann mir jemand sagen warum das nicht klappt ?</p>
<p>GRuß Timb0</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1383002</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1383002</guid><dc:creator><![CDATA[timb0]]></dc:creator><pubDate>Thu, 11 Oct 2007 16:07:30 GMT</pubDate></item><item><title><![CDATA[Reply to Dateioperationen... on Thu, 11 Oct 2007 16:58:49 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Deshalb soll man auch nicht einfachen abtippen sondern mitdenken. Wenn du die Grundlagen von C++ kennen würdest würdest du auch wissen das alle angemeckerten Symbole im Namespace std liegen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1383039</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1383039</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 11 Oct 2007 16:58:49 GMT</pubDate></item><item><title><![CDATA[Reply to Dateioperationen... on Thu, 11 Oct 2007 17:27:56 GMT]]></title><description><![CDATA[<p>Füge als einfach folgende Zeile vor deiner main Funktion ein.</p>
<pre><code class="language-cpp">using namespace std;
</code></pre>
<p>Ältere Compiler haben den Code auch ohne using namespace gefressen. Darum wurde es in den meisten älteren Büchern weggelassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1383059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1383059</guid><dc:creator><![CDATA[Chris++ 0]]></dc:creator><pubDate>Thu, 11 Oct 2007 17:27:56 GMT</pubDate></item><item><title><![CDATA[Reply to Dateioperationen... on Thu, 11 Oct 2007 18:58:40 GMT]]></title><description><![CDATA[<p>Danke leute, ich dachte eigentlich ich hätte das mit dem Namespace schon ausprobiert, ausserdem ist es gestern beim Programmieren spät geworden ..</p>
<p>Aber danke , gurß TImb0</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1383153</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1383153</guid><dc:creator><![CDATA[timb0]]></dc:creator><pubDate>Thu, 11 Oct 2007 18:58:40 GMT</pubDate></item><item><title><![CDATA[Reply to Dateioperationen... on Thu, 11 Oct 2007 19:55:24 GMT]]></title><description><![CDATA[<p>Hmm beim zerstören des Objektes std::fstream wird automatisch close aufgerufen. Weiterhin hat std::fstream einen Konstruktor um direkt die Datei zu öffnen.<br />
Und zum Schluss gibt es noch eine operator void*. Wenn der NULL zurück gibt ist ein failbit odg. gesetzt oder die Datei konnte nicht geöffnet werden.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;

int main()
{
    std::ofstream outfile(&quot;test.txt&quot;);
    if (!outfile) { std::cerr &lt;&lt; &quot;FEHLER: Datei konnte nicht geöffnet werden!&quot; &lt;&lt; std::endl; return -1; }

    outfile &lt;&lt; &quot;Das ist ein Test!&quot;&lt;&lt; std::endl;
}
</code></pre>
<p>... und das ist doch schon viel besser!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1383208</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1383208</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Thu, 11 Oct 2007 19:55:24 GMT</pubDate></item></channel></rss>