<?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[myfile.eof()]]></title><description><![CDATA[<p>SERVUS LEUTE.</p>
<p>ich habe ne recht einfache frage betreffs dateienarbeit. ich möchte gerne eine datei öffnen, an deren ende gehen, dort daten hinzufügen und dann wieder die datei schliessen. ich glaube, dass kann man mit</p>
<pre><code class="language-cpp">ofstream myfile;
</code></pre>
<p>und</p>
<pre><code class="language-cpp">myfile.eof()
</code></pre>
<p>realisieren. weis nur leider nicht WIE.</p>
<p>DANKE.<br />
STICK!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/139261/myfile-eof</link><generator>RSS for Node</generator><lastBuildDate>Sun, 30 Aug 2026 14:19:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/139261.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 05 Mar 2006 02:26:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to myfile.eof() on Sun, 05 Mar 2006 02:26:57 GMT]]></title><description><![CDATA[<p>SERVUS LEUTE.</p>
<p>ich habe ne recht einfache frage betreffs dateienarbeit. ich möchte gerne eine datei öffnen, an deren ende gehen, dort daten hinzufügen und dann wieder die datei schliessen. ich glaube, dass kann man mit</p>
<pre><code class="language-cpp">ofstream myfile;
</code></pre>
<p>und</p>
<pre><code class="language-cpp">myfile.eof()
</code></pre>
<p>realisieren. weis nur leider nicht WIE.</p>
<p>DANKE.<br />
STICK!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1008846</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1008846</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Sun, 05 Mar 2006 02:26:57 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Sun, 05 Mar 2006 07:21:03 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Wichtig ist welchen Flag du zum öffnen verwendest:</p>
<p><strong>ios_base::openmode</strong><br />
<strong>app</strong> (append) Seek to the end of the stream before each output operation<br />
<strong>ate</strong> (at end) Seek to the end of the stream when opening.<br />
<strong>binary</strong> Consider stream as binary rather than text.<br />
<strong>in</strong> Allow input operations on a stream.<br />
<strong>out</strong> Allow output operations on a stream.<br />
<strong>trunc</strong> (truncate) Truncate file to zero when opening.</p>
<p>Also in deinem Fall out und app.</p>
<pre><code class="language-cpp">std::ofstream stream( &quot;dateiname&quot;, std::ios_base::out | std::ios_base::app );

if ( !stream )
  throw std::logical_error( &quot;failed while open file&quot; );

// ...

stream.close();
</code></pre>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1008859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1008859</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Sun, 05 Mar 2006 07:21:03 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 02:46:45 GMT]]></title><description><![CDATA[<p>SERVUS.</p>
<p>ich habe versucht, diese info in meinen code einzubauen. leider gabs folgende fehlermeldung:</p>
<blockquote>
<p>error C2079: 'stream' verwendet undefiniertes class 'basic_ofstream&lt;char,struct std::char_traits&lt;char&gt; &gt;'<br />
error C2078: Zu viele Initialisierungen</p>
</blockquote>
<p>was soll das nun bedeuten?<br />
TSCHAU<br />
STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011184</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011184</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Wed, 08 Mar 2006 02:46:45 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 06:56:46 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>An welcher stelle im Code bringt der Compiler das? Hast du &lt;fstream&gt; includiert?</p>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011209</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011209</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Wed, 08 Mar 2006 06:56:46 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 08:11:30 GMT]]></title><description><![CDATA[<p>hallo.</p>
<p>- die fehlermeldung kommt genau an der stelle, an der ich deine empfohlene zeile angebracht habe.<br />
- &lt;fstream&gt; habe ich eingebunden, denn damit habe ich schon immer meine dateiarbeit erledigt. nun will ich halt einfach eine zuvor geschrieben datei öffnen und was dazufügen. das habe ich vorher nie gemacht.</p>
<p>grüsse,<br />
STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011259</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Wed, 08 Mar 2006 08:11:30 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 08:27:07 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>David_pb schrieb:</p>
<blockquote>
<pre><code class="language-cpp">std::ofstream stream( &quot;dateiname&quot;, std::ios_base::out | std::ios_base::app );
stream.close();
</code></pre>
</blockquote>
<p>das müsste eigentlich funktionieren. Kannst du mal deinen Quellcode zeigen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011271</guid><dc:creator><![CDATA[EEK]]></dc:creator><pubDate>Wed, 08 Mar 2006 08:27:07 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 11:08:39 GMT]]></title><description><![CDATA[<p>SERVUS.</p>
<p>das ist gar nicht so einfach, da das programm recht gross ist. ich versuche mal den teil herauszuschneiden, der von bedeutung ist.</p>
<pre><code>#include &quot;conio.h&quot;
#include &lt;Windows.h&gt;
#include &lt;math.h&gt;
#include &lt;string&gt;
#include &lt;sstream&gt;
#include &lt;EasyBMP.h&gt;
#include &lt;fstream.h&gt;

ofstream myfile;

void SAVE_Qn (int Punkt_Zahl, double **MatQn)
{
        int i;

	std::fstream file ( &quot;dateiname.txt&quot;, std::ios_base::out | std::ios_base::app ); 
	for (i=0;i&lt;Punkt_Zahl;i++)
		file &lt;&lt; MatQn[i][i] &lt;&lt; &quot;,&quot;;
	file.close();
}
</code></pre>
<p>die globale variable myfile macht sicher kein problem?<br />
ich hatte auch mal das problem, dass EasyBMP.h nicht in der richtigen reihenfolge eingeordnet war und dadurch probleme gemacht hat. ich weis nicht, ob dies jetzt wieder der fall sein könnte.</p>
<p>DANKE.<br />
STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011399</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Wed, 08 Mar 2006 11:08:39 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 11:15:57 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Entferne doch bitte das .h nach #include &lt;fstream&gt;. Ansonsten ist eigentlich alles richtig.</p>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011407</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011407</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Wed, 08 Mar 2006 11:15:57 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 11:21:52 GMT]]></title><description><![CDATA[<p>habe es jetzt so, das scheint auch zu funktionieren.</p>
<pre><code>#include &lt;fstream.h&gt;
#include &lt;fstream&gt;
</code></pre>
<p>damit kann ich sowohl</p>
<pre><code>ofstream myfile;
</code></pre>
<p>als auch</p>
<pre><code>std::fstream myfile ( &quot;dateiname.txt&quot;, std::ios_base::out | std::ios_base::app );
</code></pre>
<p>nutzen.</p>
<p>werde den code sicher so umgestalten, dass ich am ende nur noch zweitere version habe. danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011413</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011413</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Wed, 08 Mar 2006 11:21:52 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 11:29:21 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p><strong>NEIN</strong>, #include &lt;fstream.h&gt; fliegt ganz raus. Die standard Header haben <strong>keine</strong> .h Endung, das ist veraltet und nicht im Standard festgelegt!</p>
<p>Dafür änderst du:</p>
<pre><code class="language-cpp">ofstream myfile;
</code></pre>
<p>in</p>
<pre><code class="language-cpp">std::ofstream myfile;
</code></pre>
<p>Oder, wenn die das std:: zu viel ist (welch Faulheit ;)), schreibst du unter die Headerincudierung:</p>
<pre><code class="language-cpp">using namespace std;
</code></pre>
<p>Aber nur kein .h an die Standardheader, wie oft denn noch?</p>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011420</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011420</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Wed, 08 Mar 2006 11:29:21 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 11:32:32 GMT]]></title><description><![CDATA[<p>hmmm. das ist mir neu, dass die .h endung veraltet ist. danke für den hinweis!</p>
<p>dann müsste ich ja auch bei allen anderen headerfiles die endung entfernen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011422</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Wed, 08 Mar 2006 11:32:32 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 11:35:28 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Nein, das gilt für sämmtliche Standard C++ Headerfiles. Wie:</p>
<pre><code class="language-cpp">iostream
fstream
cstring
cmath
vector
...
</code></pre>
<p>Früher, vor langer Zeit, gab es die ganzen Header noch mit .h hintendrann. Das ist jetzt nichtmehr der Fall und soll auch nichtmehr gemacht werden.</p>
<p>Andere Header, von API's etc... können aber immer noch eine .h Endung haben. Das kommt auf die Leute an die diese Bibliotheken schreiben.</p>
<pre><code class="language-cpp">windows.h
conio.h
...
</code></pre>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011426</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011426</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Wed, 08 Mar 2006 11:35:28 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 11:35:28 GMT]]></title><description><![CDATA[<p>Bei dir sollte noch math.h durch cmath ersetzt werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011425</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011425</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 08 Mar 2006 11:35:28 GMT</pubDate></item><item><title><![CDATA[Reply to myfile.eof() on Wed, 08 Mar 2006 11:35:37 GMT]]></title><description><![CDATA[<p>Nein <strong>nur</strong> bei den Standard-Headern, aber das wirst Du merken wenn du conio.h oder windows.h die Endung klaust <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="😉"
    /> ...</p>
<p>BTW:</p>
<p>math.h -&gt; cmath</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1011427</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1011427</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Wed, 08 Mar 2006 11:35:37 GMT</pubDate></item></channel></rss>