<?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[txt komplett in einem string einlesen]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe ein Problem und zwar möchte ich eine txt komplett in einem string einlesen. habt ihr eine Idee, hab schon ne weile gegooglet aber keine vernünftige Lösung gefunden.</p>
<p>Bin über jeden Vorschlag dankbar</p>
<p>mfg Jasmin</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/274290/txt-komplett-in-einem-string-einlesen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 17:15:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/274290.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 23 Sep 2010 08:42:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to txt komplett in einem string einlesen on Thu, 23 Sep 2010 08:42:13 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe ein Problem und zwar möchte ich eine txt komplett in einem string einlesen. habt ihr eine Idee, hab schon ne weile gegooglet aber keine vernünftige Lösung gefunden.</p>
<p>Bin über jeden Vorschlag dankbar</p>
<p>mfg Jasmin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956302</guid><dc:creator><![CDATA[Jasmin]]></dc:creator><pubDate>Thu, 23 Sep 2010 08:42:13 GMT</pubDate></item><item><title><![CDATA[Reply to txt komplett in einem string einlesen on Thu, 23 Sep 2010 08:44:02 GMT]]></title><description><![CDATA[<p><a href="http://cplusplus.com/reference/iostream/istream/read/" rel="nofollow">http://cplusplus.com/reference/iostream/istream/read/</a></p>
<p>Siehe das Example dort.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956304</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956304</guid><dc:creator><![CDATA[blub* 0]]></dc:creator><pubDate>Thu, 23 Sep 2010 08:44:02 GMT</pubDate></item><item><title><![CDATA[Reply to txt komplett in einem string einlesen on Thu, 23 Sep 2010 09:32:30 GMT]]></title><description><![CDATA[<p>So spontan fallen mit dazu folgende Lösungen ein:</p>
<pre><code class="language-cpp">#include &lt;fstream&gt;
#include &lt;iostream&gt;
#include &lt;iterator&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;

int main() {
  {
    std::ifstream in(__FILE__);
    in.unsetf(std::ios::skipws);
    std::istream_iterator&lt;char&gt; fend;

    std::string s(std::istream_iterator&lt;char&gt;(in), fend);
    std::cout &lt;&lt; s;
  }

  //////////////////////////////////////////////////////

  {
    std::ifstream in(__FILE__);
    std::ostringstream out;

    out &lt;&lt; in.rdbuf();

    std::string s = out.str();

    std::cout &lt;&lt; s;
  }
}
</code></pre>
<p>Es gibt aber sicher noch mehr.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956326</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956326</guid><dc:creator><![CDATA[seldon]]></dc:creator><pubDate>Thu, 23 Sep 2010 09:32:30 GMT</pubDate></item><item><title><![CDATA[Reply to txt komplett in einem string einlesen on Thu, 23 Sep 2010 09:39:06 GMT]]></title><description><![CDATA[<p>Sicherlich nicht die eleganteste Variante, aber vermutlich eine der kürzesten:</p>
<pre><code class="language-cpp">string result;
{
  ifstream datei(&quot;datei.txt&quot;);
  stringstream puffer;
  datei&gt;&gt;puffer.rdbuf();
  result=puffer.str();
}
</code></pre>
<p>edit: Da war seldon wohl schneller...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956329</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956329</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 23 Sep 2010 09:39:06 GMT</pubDate></item></channel></rss>