<?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[file einlesen]]></title><description><![CDATA[<p>hallo,</p>
<p>ich würde gerne ein file einlesen allerdings kann ich nur eine bestimmte konstante anzahl an chars einlesen und nicht dass ganze file.</p>
<p>programmiert hab ich es nach diesem vorbild:</p>
<p><a href="http://home.fhtw-berlin.de/~junghans/cref/FUNCTIONS/fgetc.html" rel="nofollow">http://home.fhtw-berlin.de/~junghans/cref/FUNCTIONS/fgetc.html</a></p>
<p>wollte auch nachfragen ob wer einen befehl kennt um ein zeichen an einer stelle zu lesen/schreiben!</p>
<p>mfg clemens</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/192341/file-einlesen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 27 Sep 2026 11:22:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192341.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Sep 2007 08:30:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to file einlesen on Thu, 13 Sep 2007 08:30:16 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>ich würde gerne ein file einlesen allerdings kann ich nur eine bestimmte konstante anzahl an chars einlesen und nicht dass ganze file.</p>
<p>programmiert hab ich es nach diesem vorbild:</p>
<p><a href="http://home.fhtw-berlin.de/~junghans/cref/FUNCTIONS/fgetc.html" rel="nofollow">http://home.fhtw-berlin.de/~junghans/cref/FUNCTIONS/fgetc.html</a></p>
<p>wollte auch nachfragen ob wer einen befehl kennt um ein zeichen an einer stelle zu lesen/schreiben!</p>
<p>mfg clemens</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364469</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364469</guid><dc:creator><![CDATA[clemensaaa]]></dc:creator><pubDate>Thu, 13 Sep 2007 08:30:16 GMT</pubDate></item><item><title><![CDATA[Reply to file einlesen on Thu, 13 Sep 2007 08:37:05 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Zunächst einmal bist du hier im C++ Forum, also nimm auch std::fstream (Siehe FAQ, den Thread &quot;Dateien und Ströme&quot;).<br />
Auch wenn du nur einen Teil einer Datei haben willst must du erstmal bis zu dieser Stelle lesen. Es gibt keine allgemeine Funktion &quot;Öffne Datei und lies von x bis y&quot;.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364474</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364474</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 13 Sep 2007 08:37:05 GMT</pubDate></item><item><title><![CDATA[Reply to file einlesen on Thu, 13 Sep 2007 08:44:01 GMT]]></title><description><![CDATA[<p>wenn du an einer stelle xy schreiben willst, ohne vorher alles durchzulesen, solltest du dir die seek()-funktion anschauen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364480</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364480</guid><dc:creator><![CDATA[ghorst]]></dc:creator><pubDate>Thu, 13 Sep 2007 08:44:01 GMT</pubDate></item><item><title><![CDATA[Reply to file einlesen on Thu, 13 Sep 2007 11:37:57 GMT]]></title><description><![CDATA[<p>ehm std::ifstream::read | std::ifstream::seekg ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364596</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Thu, 13 Sep 2007 11:37:57 GMT</pubDate></item><item><title><![CDATA[Reply to file einlesen on Thu, 13 Sep 2007 13:56:17 GMT]]></title><description><![CDATA[<p>clemensaaa schrieb:</p>
<blockquote>
<p>ich würde gerne ein file einlesen allerdings kann ich nur eine bestimmte konstante anzahl an chars einlesen und nicht dass ganze file.</p>
</blockquote>
<p>Hallo Clemens,</p>
<p>wie ist das Format Deiner Datei, kannst Du ein Beispiel geben. Und was davon willst Du lesen und in welche Typ von Variablen (int, string, double) soll das letztendlich landen?</p>
<p>Einlesen einer Anzahl von Zeichen geht so:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;

int main()
{
    using namespace std;
    ifstream quelle( &quot;input.txt&quot; );
    string str;
    in &gt;&gt; noskipws; // auch Leerzeichen einlesen
    char c;
    for( int n = 0; n &lt; 8 &amp;&amp; in &gt;&gt; c; ++n ) // 8 Zeichen lesen
        str += c;
    cout &lt;&lt; &quot;gelesen: [&quot; &lt;&lt; str &lt;&lt; &quot;]&quot; &lt;&lt; endl;

    return 0;
}
</code></pre>
<p>Gruß<br />
Werner</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364689</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364689</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Thu, 13 Sep 2007 13:56:17 GMT</pubDate></item></channel></rss>