<?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 an Textdatei anhängen, wie mach ich das am besten???]]></title><description><![CDATA[<p>Hallo an alle! ich habe ein kleines Problem. hab hier ein Programm was soweit läuft, ich müsste die daten aber nicht einfach Ausgeben sondern an die vorher eingelesene Datei anhängen! vlt kann mir da jemand mal helfen! vielen Dank schonmal! hier mein Quelltext:</p>
<p>#include &lt;iostream&gt;<br />
#include &lt;fstream&gt;<br />
using namespace std;</p>
<p>int main (void)<br />
{</p>
<p>double xa, xe, ugrenze, ogrenze;</p>
<p>int kurz=0, lang=0, gut=0;</p>
<p>char datei[30];</p>
<p>cout&lt;&lt; &quot;\nUntergrenze in mm:&quot;;<br />
cin&gt;&gt;ugrenze;<br />
cout&lt;&lt; &quot;\nObergrenze in mm:&quot;;<br />
cin&gt;&gt;ogrenze;</p>
<p>cout&lt;&lt; &quot;\nWo stehen die Daten? &quot;;<br />
cin&gt;&gt; datei;<br />
ifstream fin(datei);</p>
<p>if(fin.fail())<br />
{<br />
cout&lt;&lt; &quot;\n\tDie Datei \&quot; &quot;&lt;&lt;datei &lt;&lt;&quot;\konnte nicht geoeffnet werden!\n\n\n&quot;;<br />
return 111;<br />
}</p>
<p>fin&gt;&gt;xa;</p>
<p>do<br />
{<br />
xe=xa;<br />
fin&gt;&gt; xa;</p>
<p>if (ugrenze&lt;=xe&amp;&amp;xe&lt;=ogrenze)<br />
gut=gut+1;<br />
else</p>
<p>if (xe&lt;ugrenze)<br />
kurz=kurz+1;<br />
else<br />
lang=lang+1</p>
<p>}while (xe!=0);</p>
<p>kurz-=1;</p>
<p>;</p>
<p>cout&lt;&lt;&quot;\n&quot; &lt;&lt;gut &lt;&lt; &quot;\tStueck in der Toleranz!&quot;;<br />
cout&lt;&lt;&quot;\n&quot; &lt;&lt;kurz &lt;&lt; &quot;\tStueck zu kurz!&quot;;<br />
cout&lt;&lt;&quot;\n&quot; &lt;&lt;lang &lt;&lt; &quot;\tStueck zu lang!&quot;;;</p>
<p>return 0;</p>
<p>}</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/196102/daten-an-textdatei-anhängen-wie-mach-ich-das-am-besten</link><generator>RSS for Node</generator><lastBuildDate>Wed, 30 Sep 2026 07:05:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/196102.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Oct 2007 12:44:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Daten an Textdatei anhängen, wie mach ich das am besten??? on Thu, 25 Oct 2007 12:44:16 GMT]]></title><description><![CDATA[<p>Hallo an alle! ich habe ein kleines Problem. hab hier ein Programm was soweit läuft, ich müsste die daten aber nicht einfach Ausgeben sondern an die vorher eingelesene Datei anhängen! vlt kann mir da jemand mal helfen! vielen Dank schonmal! hier mein Quelltext:</p>
<p>#include &lt;iostream&gt;<br />
#include &lt;fstream&gt;<br />
using namespace std;</p>
<p>int main (void)<br />
{</p>
<p>double xa, xe, ugrenze, ogrenze;</p>
<p>int kurz=0, lang=0, gut=0;</p>
<p>char datei[30];</p>
<p>cout&lt;&lt; &quot;\nUntergrenze in mm:&quot;;<br />
cin&gt;&gt;ugrenze;<br />
cout&lt;&lt; &quot;\nObergrenze in mm:&quot;;<br />
cin&gt;&gt;ogrenze;</p>
<p>cout&lt;&lt; &quot;\nWo stehen die Daten? &quot;;<br />
cin&gt;&gt; datei;<br />
ifstream fin(datei);</p>
<p>if(fin.fail())<br />
{<br />
cout&lt;&lt; &quot;\n\tDie Datei \&quot; &quot;&lt;&lt;datei &lt;&lt;&quot;\konnte nicht geoeffnet werden!\n\n\n&quot;;<br />
return 111;<br />
}</p>
<p>fin&gt;&gt;xa;</p>
<p>do<br />
{<br />
xe=xa;<br />
fin&gt;&gt; xa;</p>
<p>if (ugrenze&lt;=xe&amp;&amp;xe&lt;=ogrenze)<br />
gut=gut+1;<br />
else</p>
<p>if (xe&lt;ugrenze)<br />
kurz=kurz+1;<br />
else<br />
lang=lang+1</p>
<p>}while (xe!=0);</p>
<p>kurz-=1;</p>
<p>;</p>
<p>cout&lt;&lt;&quot;\n&quot; &lt;&lt;gut &lt;&lt; &quot;\tStueck in der Toleranz!&quot;;<br />
cout&lt;&lt;&quot;\n&quot; &lt;&lt;kurz &lt;&lt; &quot;\tStueck zu kurz!&quot;;<br />
cout&lt;&lt;&quot;\n&quot; &lt;&lt;lang &lt;&lt; &quot;\tStueck zu lang!&quot;;;</p>
<p>return 0;</p>
<p>}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1391847</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1391847</guid><dc:creator><![CDATA[wiece]]></dc:creator><pubDate>Thu, 25 Oct 2007 12:44:16 GMT</pubDate></item><item><title><![CDATA[Reply to Daten an Textdatei anhängen, wie mach ich das am besten??? on Thu, 25 Oct 2007 12:47:04 GMT]]></title><description><![CDATA[<p>Du kannst beim Anlegen der Datei noch zusätzliche Flags angeben - mit ios::app öffnest du sie zum Anhängen neuer Daten (der Standardwert öffnet sie als neue Datei und löscht bisherige Inhalte):</p>
<pre><code class="language-cpp">ifstream fin(name,ios::app);
</code></pre>
<p>PS: sfds</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1391850</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1391850</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 25 Oct 2007 12:47:04 GMT</pubDate></item><item><title><![CDATA[Reply to Daten an Textdatei anhängen, wie mach ich das am besten??? on Thu, 25 Oct 2007 12:47:16 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-18038.html" rel="nofollow">CStoll</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-1.html" rel="nofollow">MFC (Visual C++)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1391851</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1391851</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 25 Oct 2007 12:47:16 GMT</pubDate></item><item><title><![CDATA[Reply to Daten an Textdatei anhängen, wie mach ich das am besten??? on Thu, 25 Oct 2007 13:50:12 GMT]]></title><description><![CDATA[<p>Zum Beschreiben einer Datei brauchst du dann entweder ein separates ofstream-Objekt oder aber ein (les- und beschreibbares) fstream-Objekt:</p>
<pre><code class="language-cpp">std::fstream f(name, ios::app);
</code></pre>
<p>Aus einem ifstream-Objekt kann nur gelesen werden...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1391917</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1391917</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Thu, 25 Oct 2007 13:50:12 GMT</pubDate></item></channel></rss>