<?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[Schleife läuft einmal zu oft durch]]></title><description><![CDATA[<p>Bei dieser</p>
<pre><code class="language-cpp">do
	{
		c++;
		in&gt;&gt;ch;
		buffer.push_back(ch);
	}while ( !in.eof() );
</code></pre>
<p>aber auch hier</p>
<pre><code class="language-cpp">while ( !in.eof() )
	{
		c++;
		in&gt;&gt;ch;
		buffer.push_back(ch);
	}
</code></pre>
<p>hat c am Ende denn Wert 5 obwohl die Datei nur 4 Zeilen hat. Also die Liste hat fünf Einträge und keine vier. Warum ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/163266/schleife-läuft-einmal-zu-oft-durch</link><generator>RSS for Node</generator><lastBuildDate>Sun, 13 Sep 2026 00:08:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/163266.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 27 Oct 2006 15:43:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Schleife läuft einmal zu oft durch on Fri, 27 Oct 2006 15:43:08 GMT]]></title><description><![CDATA[<p>Bei dieser</p>
<pre><code class="language-cpp">do
	{
		c++;
		in&gt;&gt;ch;
		buffer.push_back(ch);
	}while ( !in.eof() );
</code></pre>
<p>aber auch hier</p>
<pre><code class="language-cpp">while ( !in.eof() )
	{
		c++;
		in&gt;&gt;ch;
		buffer.push_back(ch);
	}
</code></pre>
<p>hat c am Ende denn Wert 5 obwohl die Datei nur 4 Zeilen hat. Also die Liste hat fünf Einträge und keine vier. Warum ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1162629</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1162629</guid><dc:creator><![CDATA[franz k.]]></dc:creator><pubDate>Fri, 27 Oct 2006 15:43:08 GMT</pubDate></item><item><title><![CDATA[Reply to Schleife läuft einmal zu oft durch on Fri, 27 Oct 2006 16:00:18 GMT]]></title><description><![CDATA[<p>Das eof-Flag wird erst gesetzt, wenn versucht wird über das Dateiende hinaus zu lesen. Deine Datei ist vollständig gelesen und noch ein Durchlauf der das eof-flag dann setzt. in.good() nehmen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1162636</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1162636</guid><dc:creator><![CDATA[freak11]]></dc:creator><pubDate>Fri, 27 Oct 2006 16:00:18 GMT</pubDate></item></channel></rss>