<?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[Problem beim Schreiben in eine .txt Datei.]]></title><description><![CDATA[<p>Hallo,<br />
Ich habe ein Problem.Ich will einfach eine 1 in eine .txt Datei schreiben.<br />
Ich hab es einfach mal so probiert:</p>
<p>file.open(&quot;open.txt&quot;,ios::out);<br />
file&lt;&lt;&quot;1&quot;;</p>
<p>Aber irgentwie hat er Probleme mit &lt;&lt; --&gt; No match for operator &quot;&lt;&lt;&quot; in file&lt;&lt;&quot;1&quot;;<br />
Könnt ihr mir vielleicht weiter helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/188570/problem-beim-schreiben-in-eine-txt-datei</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 03:11:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/188570.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Aug 2007 20:49:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem beim Schreiben in eine .txt Datei. on Wed, 01 Aug 2007 20:49:40 GMT]]></title><description><![CDATA[<p>Hallo,<br />
Ich habe ein Problem.Ich will einfach eine 1 in eine .txt Datei schreiben.<br />
Ich hab es einfach mal so probiert:</p>
<p>file.open(&quot;open.txt&quot;,ios::out);<br />
file&lt;&lt;&quot;1&quot;;</p>
<p>Aber irgentwie hat er Probleme mit &lt;&lt; --&gt; No match for operator &quot;&lt;&lt;&quot; in file&lt;&lt;&quot;1&quot;;<br />
Könnt ihr mir vielleicht weiter helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336858</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336858</guid><dc:creator><![CDATA[shorty0802]]></dc:creator><pubDate>Wed, 01 Aug 2007 20:49:40 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Schreiben in eine .txt Datei. on Wed, 01 Aug 2007 20:59:13 GMT]]></title><description><![CDATA[<pre><code>darthdespotism@akazieLX:~$ cat main.cpp
#include &lt;iostream&gt;
#include &lt;fstream&gt;

int main()
{
        std::fstream out(&quot;out.txt&quot;, std::ios::out);
        out &lt;&lt; &quot;1&quot;;
}
darthdespotism@akazieLX:~$ g++ main.cpp -ansi -pedantic
darthdespotism@akazieLX:~$
</code></pre>
<p>Lass mal mehr Code sehen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336864</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336864</guid><dc:creator><![CDATA[darthdespotism]]></dc:creator><pubDate>Wed, 01 Aug 2007 20:59:13 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Schreiben in eine .txt Datei. on Wed, 01 Aug 2007 21:12:20 GMT]]></title><description><![CDATA[<p>Ja also der Rest hat eiegntlcih mit der Sache nix zu tun, aber ich hab mal versucht nen bissl mehr zu schicken.</p>
<p>#include&lt;string.h&gt;<br />
#include&lt;iostream&gt;<br />
#include&lt;fstream&gt;</p>
<p>using namespace std;</p>
<p>int meineklasse::meinememberfunktion()<br />
{<br />
file.open(&quot;open.txt&quot;,ios::in);<br />
int buchstabe=0;<br />
int zeile=1;<br />
int i=0;<br />
ifstream file2;<br />
file2.open(&quot;open.txt&quot;,ios::out);<br />
while(!file.eof())<br />
{<br />
string s;<br />
getline(file,s);<br />
s=m_textline[256];<br />
while(buchstabe&lt;256){<br />
if(m_textline[buchstabe]=='a')<br />
{<br />
file2&lt;&lt;&quot;1&quot;;<br />
};<br />
}<br />
}<br />
Kann sein dass da jetz viel scheiße dabei is weil des eigentlich ein &quot;größeres&quot; Programm werden soll und jetz halt keinen Zusammenhang hat. Diese Memberfunktion soll aber eigendlich nur von einer Text Datei alle Buchstaben in eine andere kopieren nur halt a =1 b=2 ..... und bei dem 1 in die andere Text Datei schreiben hängt es.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336878</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336878</guid><dc:creator><![CDATA[shorty0802]]></dc:creator><pubDate>Wed, 01 Aug 2007 21:12:20 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Schreiben in eine .txt Datei. on Wed, 01 Aug 2007 21:46:12 GMT]]></title><description><![CDATA[<p>Du hast file2 als <strong>i</strong>fstream deklariert, der zum <strong>einlesen</strong> und nicht zum <strong>schreiben</strong> gedacht ist. Daher kennt dieser auch keine Streamausgabe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336907</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336907</guid><dc:creator><![CDATA[darthdespotism]]></dc:creator><pubDate>Wed, 01 Aug 2007 21:46:12 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Schreiben in eine .txt Datei. on Thu, 02 Aug 2007 06:38:22 GMT]]></title><description><![CDATA[<p>#include&lt;string.h&gt;<br />
#include&lt;iostream&gt;<br />
#include&lt;fstream&gt;</p>
<p>using namespace std;</p>
<p>int meineklasse::meinememberfunktion()<br />
{<br />
<strong>ifstream file;</strong><br />
file.open(&quot;open.txt&quot;,ios::in);<br />
int buchstabe=0;<br />
int zeile=1;<br />
int i=0;<br />
<strong>ofstream file2;</strong><br />
file2.open(&quot;open.txt&quot;,ios::out);<br />
while(!file.eof())<br />
{<br />
string s;<br />
getline(file,s);<br />
s=m_textline[256];<br />
while(buchstabe&lt;256){<br />
if(m_textline[buchstabe]=='a')<br />
{<br />
file2&lt;&lt;&quot;1&quot;;<br />
};<br />
}<br />
}</p>
<p>Aber warum öffnest du die Datei &quot;open.txt&quot; zwei mal? Das ist sehr unsauber und kann zu Fehlern führen. Du solltest <strong>entweder</strong> zum lesen <strong>oder</strong> zum schreiben öffnen.</p>
<p>Am besten die Datei öffnen, operation ausführen und Datei wieder schließen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336998</guid><dc:creator><![CDATA[Ceene]]></dc:creator><pubDate>Thu, 02 Aug 2007 06:38:22 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Schreiben in eine .txt Datei. on Thu, 02 Aug 2007 09:03:29 GMT]]></title><description><![CDATA[<p>Ups file 2 und file sollen zwei verschiedene Text documente sein.Und ich kann die nicht gleich wieder schließen weil meine Lese makierer oder wie man des nennt da stehen bleiben muss. Jetz geht es endlich danke !!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1337111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1337111</guid><dc:creator><![CDATA[shorty0802]]></dc:creator><pubDate>Thu, 02 Aug 2007 09:03:29 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Schreiben in eine .txt Datei. on Thu, 02 Aug 2007 09:13:54 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39411" rel="nofollow">Schreibt eure Codes mal mit Syntaxcoloring</a> -dann wirds leserlicher <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1337116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1337116</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 02 Aug 2007 09:13:54 GMT</pubDate></item></channel></rss>