<?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[newbie fehler ?]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;fstream&gt;
#include &lt;iostream&gt;                
using namespace std;     
int main ()                                   
{
    char* quelldatei = &quot;erste.txt&quot;;
    char* zieldatei  = &quot;zweite.txt&quot;;
    char  ip;
    string str1;
    ifstream quelle(quelldatei);
    ofstream ziel(zieldatei);
    while (quelle.get(ip)) 
    {
          ziel &lt;&lt; &quot;http://&quot; &lt;&lt; ip &lt;&lt; &quot;:6346&quot;;
          if (ip == '\n')   
             ziel &lt;&lt; &quot;\n&quot;;     
    }
    quelle.close ();
    ziel.close ();
    return 0;
}
</code></pre>
<p>und ihn der DATEI &quot;erste.TXT&quot;<br />
ist eine ip adresse drinne die wird ausgelesen und so verändert<br />
http://&quot;ip adresse&quot; :6346 und diese wird dann ihn die &quot;zweite.TXT&quot; gespeichert doch es gibt ein problem die ip adresse wo gespeichert werden soll sieht im gespeicherten zustand so aus :</p>
<p>http://8:6346http://4:6346http://.:6346http://5:6346http://6:6346http://.:6346http://1:6346http://1:6346http://.:6346http://2:6346http://2:6346http://<br />
:6346</p>
<p>An was kann das liegen die ip adress ihn &quot;erste.txt&quot; steht ihn einer zeile<br />
habe ich irgendetwas vergessen ?</p>
<p><strong>&lt;edit&gt;Bitte Code-Tags verwenden!&lt;/edit&gt;</strong></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/120868/newbie-fehler</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 12:17:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/120868.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 17 Sep 2005 00:14:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to newbie fehler ? on Sun, 18 Sep 2005 10:58:08 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;fstream&gt;
#include &lt;iostream&gt;                
using namespace std;     
int main ()                                   
{
    char* quelldatei = &quot;erste.txt&quot;;
    char* zieldatei  = &quot;zweite.txt&quot;;
    char  ip;
    string str1;
    ifstream quelle(quelldatei);
    ofstream ziel(zieldatei);
    while (quelle.get(ip)) 
    {
          ziel &lt;&lt; &quot;http://&quot; &lt;&lt; ip &lt;&lt; &quot;:6346&quot;;
          if (ip == '\n')   
             ziel &lt;&lt; &quot;\n&quot;;     
    }
    quelle.close ();
    ziel.close ();
    return 0;
}
</code></pre>
<p>und ihn der DATEI &quot;erste.TXT&quot;<br />
ist eine ip adresse drinne die wird ausgelesen und so verändert<br />
http://&quot;ip adresse&quot; :6346 und diese wird dann ihn die &quot;zweite.TXT&quot; gespeichert doch es gibt ein problem die ip adresse wo gespeichert werden soll sieht im gespeicherten zustand so aus :</p>
<p>http://8:6346http://4:6346http://.:6346http://5:6346http://6:6346http://.:6346http://1:6346http://1:6346http://.:6346http://2:6346http://2:6346http://<br />
:6346</p>
<p>An was kann das liegen die ip adress ihn &quot;erste.txt&quot; steht ihn einer zeile<br />
habe ich irgendetwas vergessen ?</p>
<p><strong>&lt;edit&gt;Bitte Code-Tags verwenden!&lt;/edit&gt;</strong></p>
]]></description><link>https://www.c-plusplus.net/forum/post/874109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874109</guid><dc:creator><![CDATA[L.o.K]]></dc:creator><pubDate>Sun, 18 Sep 2005 10:58:08 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 00:57:25 GMT]]></title><description><![CDATA[<p>L.o.K schrieb:</p>
<blockquote>
<p>und ihn der DATEI &quot;erste.TXT&quot;<br />
ist eine ip adresse drinne die wird ausgelesen und so verändert<br />
http://&quot;ip adresse&quot; :6346 und diese wird dann ihn die &quot;zweite.TXT&quot; gespeichert doch es gibt ein problem die ip adresse**, die** gespeichert werden soll sieht im gespeicherten zustand so aus :</p>
</blockquote>
<p>Du liest in der while-Schleife ein einzelnes Zeichen ein und fügst das dann mit http:// und :6346 in den neuen Stream ein, ist ja klar, dass das dann so aussieht. In ip ist also kein Platz für eine komplette IP-Adresse. Lies am besten eine Zeile deiner ersten Datei mit getline statt get in einen string ein und füge es dann in den zweiten Filestream ein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/874115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874115</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Sat, 17 Sep 2005 00:57:25 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 01:02:41 GMT]]></title><description><![CDATA[<p>Hi wenn ich while (quelle.getline(ip)) mache dann funktioniert es nicht mehr bin newbie</p>
<p>L.o.K schrieb:</p>
<blockquote>
<p>#include &lt;string&gt;<br />
#include &lt;fstream&gt;<br />
#include &lt;iostream&gt;<br />
using namespace std;<br />
int main ()<br />
{<br />
char* quelldatei = &quot;erste.txt&quot;;<br />
char* zieldatei = &quot;zweite.txt&quot;;<br />
char ip;<br />
string str1;<br />
ifstream quelle(quelldatei);<br />
ofstream ziel(zieldatei);<br />
while (quelle.getline(ip))<br />
{<br />
ziel &lt;&lt; &quot;http://&quot; &lt;&lt; ip &lt;&lt; &quot;:6346&quot;;<br />
if (ip == '\n')<br />
ziel &lt;&lt; &quot;\n&quot;;<br />
}<br />
quelle.close ();<br />
ziel.close ();<br />
return 0;<br />
}</p>
<p>und ihn der DATEI &quot;erste.TXT&quot;<br />
ist eine ip adresse drinne die wird ausgelesen und so verändert<br />
http://&quot;ip adresse&quot; :6346 und diese wird dann ihn die &quot;zweite.TXT&quot; gespeichert doch es gibt ein problem die ip adresse wo gespeichert werden soll sieht im gespeicherten zustand so aus :</p>
<p>http://8:6346http://4:6346http://.:6346http://5:6346http://6:6346http://.:6346http://1:6346http://1:6346http://.:6346http://2:6346http://2:6346http://<br />
:6346</p>
<p>An was kann das liegen die ip adress ihn &quot;erste.txt&quot; steht ihn einer zeile<br />
habe ich irgendetwas vergessen ?</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/874116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874116</guid><dc:creator><![CDATA[L.O.K]]></dc:creator><pubDate>Sat, 17 Sep 2005 01:02:41 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 15:13:40 GMT]]></title><description><![CDATA[<p>Du musst eine ganze Zeile natürlich in einen string einlesen. <strong>ip</strong> ist keiner.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/874392</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874392</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Sat, 17 Sep 2005 15:13:40 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 16:01:13 GMT]]></title><description><![CDATA[<p>wie mache ich das kann mir keiner ein beisiel schreiben bitte ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/874422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874422</guid><dc:creator><![CDATA[Fragnatic]]></dc:creator><pubDate>Sat, 17 Sep 2005 16:01:13 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 16:07:20 GMT]]></title><description><![CDATA[<p>vielleicht so ?</p>
<pre><code class="language-cpp">string str1;
ifstream quelle(quelldatei);
ofstream ziel(zieldatei);
getline(quelle, str1);
ziel &lt;&lt; &quot;http://&quot; &lt;&lt; str1 &lt;&lt; &quot;:6346&quot;;
</code></pre>
<p>Kurt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/874426</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874426</guid><dc:creator><![CDATA[ZuK]]></dc:creator><pubDate>Sat, 17 Sep 2005 16:07:20 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 16:44:05 GMT]]></title><description><![CDATA[<p>Danke ! :)I</p>
]]></description><link>https://www.c-plusplus.net/forum/post/874441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874441</guid><dc:creator><![CDATA[Fragnatic]]></dc:creator><pubDate>Sat, 17 Sep 2005 16:44:05 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 16:50:48 GMT]]></title><description><![CDATA[<p>So kommt es jetzt ihn der zweite.txt raus sind jetzt zwar eine ganze ip zwischen http:// die ip :6346 aber warum macht es dies so oft ?</p>
<p>http://84.56.11.22:6346http://84.56.11.22:6346http://84.56.11.22:6346http://84.56.11.22:6346http://84.56.11.22:6346http://84.56.11.22:6346http://84.56.11.22:6346http://84.56.11.22:6346http://84.56.11.22:6346http://84.56.11.22:6346http://84.56.11.22:6346http://84.56.11.22:6346</p>
<p>Bitte um hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/874444</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874444</guid><dc:creator><![CDATA[Fragnatic]]></dc:creator><pubDate>Sat, 17 Sep 2005 16:50:48 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 17:27:35 GMT]]></title><description><![CDATA[<p>Wahrscheinlich hast du das while noch immer. Zeig deinen code.<br />
Kurt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/874466</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874466</guid><dc:creator><![CDATA[ZuK]]></dc:creator><pubDate>Sat, 17 Sep 2005 17:27:35 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sun, 18 Sep 2005 10:58:34 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;fstream&gt;
#include &lt;iostream&gt;                
using namespace std;     
int main ()                                   
{
    char* quelldatei = &quot;erste.txt&quot;;
    char* zieldatei  = &quot;zweite.txt&quot;;
    char  ip;
    string str1; 
    ifstream quelle(quelldatei); 
    ofstream ziel(zieldatei); 
    getline(quelle, str1); 
    while (quelle.get(ip)) 
    {
    ziel &lt;&lt; &quot;http://&quot; &lt;&lt; str1 &lt;&lt; &quot;:6346&quot;;
    if (ip == '\n')   
    ziel &lt;&lt; &quot;\n&quot;;     
    };
    quelle.close ();
    ziel.close ();
    return 0;
}
</code></pre>
<p><strong>&lt;edit&gt;Bitte Code-Tags verwenden!&lt;/edit&gt;</strong></p>
]]></description><link>https://www.c-plusplus.net/forum/post/874491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874491</guid><dc:creator><![CDATA[L.o.K]]></dc:creator><pubDate>Sun, 18 Sep 2005 10:58:34 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 18:04:36 GMT]]></title><description><![CDATA[<p>Besser so</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;fstream&gt;
#include &lt;iostream&gt;
using namespace std;
int main () {
   char* quelldatei = &quot;erste.txt&quot;;
   char* zieldatei = &quot;zweite.txt&quot;;
   string str1;
   ifstream quelle(quelldatei);
   ofstream ziel(zieldatei);
   getline(quelle, str1);
   ziel &lt;&lt; &quot;http://&quot; &lt;&lt; str1 &lt;&lt; &quot;:6346&quot; &lt;&lt; endl;
   quelle.close ();
   ziel.close ();
   return 0;
}
</code></pre>
<p>Kurt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/874495</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874495</guid><dc:creator><![CDATA[ZuK]]></dc:creator><pubDate>Sat, 17 Sep 2005 18:04:36 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 18:09:34 GMT]]></title><description><![CDATA[<p>Ja Danke ! Klappt alles echt big thnx an dich <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>
]]></description><link>https://www.c-plusplus.net/forum/post/874497</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874497</guid><dc:creator><![CDATA[L.O.K]]></dc:creator><pubDate>Sat, 17 Sep 2005 18:09:34 GMT</pubDate></item><item><title><![CDATA[Reply to newbie fehler ? on Sat, 17 Sep 2005 18:11:31 GMT]]></title><link>https://www.c-plusplus.net/forum/post/874499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/874499</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Sat, 17 Sep 2005 18:11:31 GMT</pubDate></item></channel></rss>