<?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[tellg() gibt falschen wert zurück]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich hab eine Textdatei mit 12 Zeilen.<br />
Mein Code soll die Datei öffnen und die Zeilenanzahl feststellen.<br />
in.tellg() liefert 214 statt 12 zurück. Hat jemand eine Idee woran das<br />
liegen könnte ?</p>
<p>Danke.</p>
<p>if (in.is_open()) {<br />
cout &lt;&lt; &quot;reading file &quot; &lt;&lt; filename &lt;&lt; &quot; ....\n&quot; ;<br />
in.seekg (0, ios::end);<br />
int pos = in.tellg();<br />
printf(&quot;%i\n&quot;, pos);<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/193937/tellg-gibt-falschen-wert-zurück</link><generator>RSS for Node</generator><lastBuildDate>Mon, 28 Sep 2026 08:35:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/193937.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Oct 2007 23:24:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to tellg() gibt falschen wert zurück on Mon, 01 Oct 2007 23:24:56 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich hab eine Textdatei mit 12 Zeilen.<br />
Mein Code soll die Datei öffnen und die Zeilenanzahl feststellen.<br />
in.tellg() liefert 214 statt 12 zurück. Hat jemand eine Idee woran das<br />
liegen könnte ?</p>
<p>Danke.</p>
<p>if (in.is_open()) {<br />
cout &lt;&lt; &quot;reading file &quot; &lt;&lt; filename &lt;&lt; &quot; ....\n&quot; ;<br />
in.seekg (0, ios::end);<br />
int pos = in.tellg();<br />
printf(&quot;%i\n&quot;, pos);<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1376267</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1376267</guid><dc:creator><![CDATA[jnengel]]></dc:creator><pubDate>Mon, 01 Oct 2007 23:24:56 GMT</pubDate></item><item><title><![CDATA[Reply to tellg() gibt falschen wert zurück on Mon, 01 Oct 2007 23:30:02 GMT]]></title><description><![CDATA[<p>tellg() liefert die Position des get-Zeigers zurück, allerdings werden nicht die Zeilen, sondern die Zeichen gezählt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1376268</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1376268</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Mon, 01 Oct 2007 23:30:02 GMT</pubDate></item></channel></rss>