<?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[getline funktioniert nicht als abbrechbedingung]]></title><description><![CDATA[<p>Wieso habe ich ne Endlosschleife hier obwohl ich eigtl eine Abbrechbedingung habe?</p>
<pre><code class="language-cpp">while(getline(input_file,line_of_interrest))
	{
      koordinaten = (line_of_interrest.substr(line_of_interrest.rfind(&quot;(&quot;), line_of_interrest.rfind(&quot;)&quot; - line_of_interrest.rfind(&quot;(&quot;))));
      berechne_koos(x,y,koordinaten);
      name = (line_of_interrest.erase(line_of_interrest.rfind(&quot;(&quot;), line_of_interrest.length() - line_of_interrest.rfind(&quot;(&quot;))); 
      langsamste_einheit = (einheit_choose());
      Dorf buffer(0,langsamste_einheit,x,y,name);
      spieler.push_back(buffer);
    }
</code></pre>
<p>inputfile is vom typ ifstream.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/260170/getline-funktioniert-nicht-als-abbrechbedingung</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 09:34:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/260170.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Feb 2010 20:33:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to getline funktioniert nicht als abbrechbedingung on Mon, 01 Feb 2010 20:33:24 GMT]]></title><description><![CDATA[<p>Wieso habe ich ne Endlosschleife hier obwohl ich eigtl eine Abbrechbedingung habe?</p>
<pre><code class="language-cpp">while(getline(input_file,line_of_interrest))
	{
      koordinaten = (line_of_interrest.substr(line_of_interrest.rfind(&quot;(&quot;), line_of_interrest.rfind(&quot;)&quot; - line_of_interrest.rfind(&quot;(&quot;))));
      berechne_koos(x,y,koordinaten);
      name = (line_of_interrest.erase(line_of_interrest.rfind(&quot;(&quot;), line_of_interrest.length() - line_of_interrest.rfind(&quot;(&quot;))); 
      langsamste_einheit = (einheit_choose());
      Dorf buffer(0,langsamste_einheit,x,y,name);
      spieler.push_back(buffer);
    }
</code></pre>
<p>inputfile is vom typ ifstream.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848825</guid><dc:creator><![CDATA[Jud4s]]></dc:creator><pubDate>Mon, 01 Feb 2010 20:33:24 GMT</pubDate></item><item><title><![CDATA[Reply to getline funktioniert nicht als abbrechbedingung on Mon, 01 Feb 2010 20:40:21 GMT]]></title><description><![CDATA[<p>Weil die Abbruchbedingung immer 'true' ist!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848831</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848831</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Mon, 01 Feb 2010 20:40:21 GMT</pubDate></item><item><title><![CDATA[Reply to getline funktioniert nicht als abbrechbedingung on Mon, 01 Feb 2010 20:42:40 GMT]]></title><description><![CDATA[<p>Schon mal mit dem Debugger durchgegangen? Veränderst du irgendwo in der Schleife durch Funktionsaufrufe <code>input_file</code> ? Ich meine zum Beispiel durch <code>berechne_koos</code> oder dem erstellen von diesem Pufferdorf (Ein Pufferdorf? :D).</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848833</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Mon, 01 Feb 2010 20:42:40 GMT</pubDate></item><item><title><![CDATA[Reply to getline funktioniert nicht als abbrechbedingung on Mon, 01 Feb 2010 20:48:17 GMT]]></title><description><![CDATA[<p>Input_file wird nicht verändert.</p>
<p>Gibts eine andere Möglichkeit die Schleife zu machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848839</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848839</guid><dc:creator><![CDATA[Jud4s]]></dc:creator><pubDate>Mon, 01 Feb 2010 20:48:17 GMT</pubDate></item><item><title><![CDATA[Reply to getline funktioniert nicht als abbrechbedingung on Mon, 01 Feb 2010 20:49:37 GMT]]></title><description><![CDATA[<p>Vielleicht <em>input_file.eof()</em> prüfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848841</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848841</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Mon, 01 Feb 2010 20:49:37 GMT</pubDate></item><item><title><![CDATA[Reply to getline funktioniert nicht als abbrechbedingung on Mon, 01 Feb 2010 21:17:42 GMT]]></title><description><![CDATA[<p>auch schon probiert klappt net.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848864</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848864</guid><dc:creator><![CDATA[Jud4s]]></dc:creator><pubDate>Mon, 01 Feb 2010 21:17:42 GMT</pubDate></item><item><title><![CDATA[Reply to getline funktioniert nicht als abbrechbedingung on Mon, 01 Feb 2010 21:35:45 GMT]]></title><description><![CDATA[<p>David_pb schrieb:</p>
<blockquote>
<p>Vielleicht <em>input_file.eof()</em> prüfen?</p>
</blockquote>
<p>Käme auf das gleiche hinaus, im Gegenteil, du würdest eine Linie zu viel lesen.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/18822">@Jud4s</a>,<br />
Wie gesagt, geh mal mit dem Debugger durch.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848882</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848882</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Mon, 01 Feb 2010 21:35:45 GMT</pubDate></item><item><title><![CDATA[Reply to getline funktioniert nicht als abbrechbedingung on Tue, 02 Feb 2010 15:36:57 GMT]]></title><description><![CDATA[<p>was soll ich denn da genau mit dem Debugger finden? Ich bin da durch gegangen aber die Feststellung bleibt. getline gibt kein False wenn eof erreicht ist und ich versteh nicht wieso, bei anderen Codes hat das immer geklappt.</p>
<p>Liegt das daran das input_file n ifstream ist und ich somit aus nem ifstream lese und nicht aus std::cin?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1849226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1849226</guid><dc:creator><![CDATA[Judas]]></dc:creator><pubDate>Tue, 02 Feb 2010 15:36:57 GMT</pubDate></item><item><title><![CDATA[Reply to getline funktioniert nicht als abbrechbedingung on Tue, 02 Feb 2010 15:41:38 GMT]]></title><description><![CDATA[<p>eof ist doch idr -1 und while(-1){} ist ne endlos schleife <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/1849228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1849228</guid><dc:creator><![CDATA[noobLolo]]></dc:creator><pubDate>Tue, 02 Feb 2010 15:41:38 GMT</pubDate></item><item><title><![CDATA[Reply to getline funktioniert nicht als abbrechbedingung on Tue, 02 Feb 2010 15:46:27 GMT]]></title><description><![CDATA[<p>sry ich muß unbedingt aufhören c und c++ zu vermischen, das taugt nix, also diesen und den letzten post nicht beachten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1849231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1849231</guid><dc:creator><![CDATA[noobLolo]]></dc:creator><pubDate>Tue, 02 Feb 2010 15:46:27 GMT</pubDate></item></channel></rss>