<?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 so sicher?]]></title><description><![CDATA[<pre><code class="language-cpp">std::vector&lt;char&gt; data(filesize);
	std::ifstream file(filename);
	if(file){
		file.read(&amp;data[0], data.size());
	}
</code></pre>
<p>Ist das sicher, dass das immer gut geht? Gibts was besseres?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/218883/file-einlesen-so-sicher</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 15:10:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/218883.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 26 Jul 2008 18:16:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to File einlesen so sicher? on Sat, 26 Jul 2008 18:16:07 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::vector&lt;char&gt; data(filesize);
	std::ifstream file(filename);
	if(file){
		file.read(&amp;data[0], data.size());
	}
</code></pre>
<p>Ist das sicher, dass das immer gut geht? Gibts was besseres?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1554135</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1554135</guid><dc:creator><![CDATA[pöpä]]></dc:creator><pubDate>Sat, 26 Jul 2008 18:16:07 GMT</pubDate></item><item><title><![CDATA[Reply to File einlesen so sicher? on Sat, 26 Jul 2008 22:05:39 GMT]]></title><description><![CDATA[<p>pöpä schrieb:</p>
<blockquote>
<pre><code class="language-cpp">std::vector&lt;char&gt; data(filesize);
	std::ifstream file(filename);
	if(file){
		file.read(&amp;data[0], data.size());
	}
</code></pre>
<p>Ist das sicher, dass das immer gut geht? ...</p>
</blockquote>
<p>Nö.<br />
Es gibt immer Rahmenbedingungen, in denen das schief geht.<br />
Kurzfassung: Binärspeichern sein lassen!!</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1554273</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1554273</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Sat, 26 Jul 2008 22:05:39 GMT</pubDate></item><item><title><![CDATA[Reply to File einlesen so sicher? on Sat, 26 Jul 2008 22:42:18 GMT]]></title><description><![CDATA[<p>pöpä schrieb:</p>
<blockquote>
<p>Gibts was besseres?</p>
</blockquote>
<p>Speichern und Laden aus Textdatei (auch mit <code>fstream</code> möglich).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1554289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1554289</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sat, 26 Jul 2008 22:42:18 GMT</pubDate></item><item><title><![CDATA[Reply to File einlesen so sicher? on Sun, 27 Jul 2008 00:51:50 GMT]]></title><description><![CDATA[<p>Simon2 schrieb:</p>
<blockquote>
<p>Kurzfassung: Binärspeichern sein lassen!!</p>
</blockquote>
<p>Könntest du mir da auch eine längere Beschreibung geben, das würde mich mal interessieren.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1554320</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1554320</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Sun, 27 Jul 2008 00:51:50 GMT</pubDate></item><item><title><![CDATA[Reply to File einlesen so sicher? on Sun, 27 Jul 2008 05:33:13 GMT]]></title><description><![CDATA[<p>Simon2 schrieb:</p>
<blockquote>
<p>pöpä schrieb:</p>
<blockquote>
<pre><code class="language-cpp">std::vector&lt;char&gt; data(filesize);
	std::ifstream file(filename);
	if(file){
		file.read(&amp;data[0], data.size());
	}
</code></pre>
<p>Ist das sicher, dass das immer gut geht? ...</p>
</blockquote>
<p>Nö.<br />
Es gibt immer Rahmenbedingungen, in denen das schief geht.<br />
Kurzfassung: Binärspeichern sein lassen!!</p>
</blockquote>
<p>Darum gehts nicht. Ich will nicht irgendwelche structs so lesen und schreiben. Bilder, Videos usw. werden sogut wie immer binär gespeichert. Es geht und das &amp;data[0], data.size(). Kann man sicher sein, dass file.read immer Problemlos dort hinschreiben kann, ohne das was im std::vector kaputt gemacht wird?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1554339</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1554339</guid><dc:creator><![CDATA[pöpä]]></dc:creator><pubDate>Sun, 27 Jul 2008 05:33:13 GMT</pubDate></item><item><title><![CDATA[Reply to File einlesen so sicher? on Sun, 27 Jul 2008 19:00:49 GMT]]></title><description><![CDATA[<p>pöpä schrieb:</p>
<blockquote>
<p>...Darum gehts nicht. Ich will nicht irgendwelche structs so lesen und schreiben. Bilder, Videos usw. ...</p>
</blockquote>
<p>Sorry, hatte ich mißverstanden.<br />
Ich ziehe mein Post zurück.</p>
<p>Tut mir leid,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1554738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1554738</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Sun, 27 Jul 2008 19:00:49 GMT</pubDate></item></channel></rss>