<?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[gesamtgröße bestimmen ?]]></title><description><![CDATA[<p>Hallo alle <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Mein c++ programm &quot;läd&quot; eine Datei in einen unsigned char.<br />
Ich weiß das die datei 120.000 Bytes groß ist.</p>
<p>Aber wie schaffe ich es jetzt, die größe meiner Datei nur anhand des unsigned chars(indem sich der Inhalt der Datei befinded) herauszufinden ??</p>
<p>Danke für eure Hilfe</p>
<p>Greetz</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/245746/gesamtgröße-bestimmen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 13:08:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/245746.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Jul 2009 08:41:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to gesamtgröße bestimmen ? on Sat, 18 Jul 2009 08:41:14 GMT]]></title><description><![CDATA[<p>Hallo alle <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Mein c++ programm &quot;läd&quot; eine Datei in einen unsigned char.<br />
Ich weiß das die datei 120.000 Bytes groß ist.</p>
<p>Aber wie schaffe ich es jetzt, die größe meiner Datei nur anhand des unsigned chars(indem sich der Inhalt der Datei befinded) herauszufinden ??</p>
<p>Danke für eure Hilfe</p>
<p>Greetz</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1745156</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1745156</guid><dc:creator><![CDATA[lolwurst]]></dc:creator><pubDate>Sat, 18 Jul 2009 08:41:14 GMT</pubDate></item><item><title><![CDATA[Reply to gesamtgröße bestimmen ? on Sat, 18 Jul 2009 08:47:06 GMT]]></title><description><![CDATA[<p>lolwurst schrieb:</p>
<blockquote>
<p>Mein c++ programm &quot;läd&quot; eine Datei in einen unsigned char.<br />
Ich weiß das die datei 120.000 Bytes groß ist.</p>
</blockquote>
<p>Nein. Ein unsigned char ist ein Byte. Was tust Du wirklich? Im Zweifel zeig etwas Code.</p>
<p>(Ganz allgemein: Zumeist musst Du beim Laden einfach mitzählen)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1745158</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1745158</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Sat, 18 Jul 2009 08:47:06 GMT</pubDate></item><item><title><![CDATA[Reply to gesamtgröße bestimmen ? on Sat, 18 Jul 2009 09:22:31 GMT]]></title><description><![CDATA[<p>Warum muss es denn unbedingt nur anhand des uchars sein?<br />
Verwende doch <a href="http://www.boost.org/doc/libs/1_39_0/libs/filesystem/doc/reference.html" rel="nofollow">Boost.FileSystem</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1745164</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1745164</guid><dc:creator><![CDATA[Klosteher]]></dc:creator><pubDate>Sat, 18 Jul 2009 09:22:31 GMT</pubDate></item><item><title><![CDATA[Reply to gesamtgröße bestimmen ? on Sat, 18 Jul 2009 09:43:54 GMT]]></title><description><![CDATA[<p>lolwurst schrieb:</p>
<blockquote>
<p>...</p>
</blockquote>
<p>Naja kommt drauf an wie du die Datei in dein Char lädst. Zeig doch mal wie du es die Datei da reinbekommst. Solltest du Byte für Byte in dein Char laden, kannst du einen Zähler mitlaufen lassen.</p>
<p>Klosteher schrieb:</p>
<blockquote>
<p>Verwende doch Boost.FileSystem</p>
</blockquote>
<p>Also einfach das Problem mit etwas vorhandenem lösen und in Unwissenheit versenken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1745168</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1745168</guid><dc:creator><![CDATA[freaky]]></dc:creator><pubDate>Sat, 18 Jul 2009 09:43:54 GMT</pubDate></item><item><title><![CDATA[Reply to gesamtgröße bestimmen ? on Sat, 18 Jul 2009 13:54:56 GMT]]></title><description><![CDATA[<p>Ich reserviere Speicher für den Unsigned Char mit malloc</p>
<p>Bsp:</p>
<p>unsigned char* test = NULL;<br />
test = malloc(200000)<br />
test = dateiInhalt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1745321</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1745321</guid><dc:creator><![CDATA[lolwurst]]></dc:creator><pubDate>Sat, 18 Jul 2009 13:54:56 GMT</pubDate></item><item><title><![CDATA[Reply to gesamtgröße bestimmen ? on Sat, 18 Jul 2009 15:07:59 GMT]]></title><description><![CDATA[<p>Omg! Zeiger, Referenzen, primitive Datentypen, ... all das sollte man schon auseinander halten. Auch ist dein Code wohl kein Standard-C++. Falls du schon programmieren kannst, dann empfehle ich dir <a href="http://www.amazon.de/C-Programmiersprache-Studentenausgabe-Bjarne-Stroustrup/dp/3827317568/ref=sr_1_5?ie=UTF8&amp;s=books&amp;qid=1247929514&amp;sr=8-5" rel="nofollow">Die C++ Programmiersprache</a>. Dort wirst du keine Antwort auf deine Frage finden, aber vielleicht genug Wissen, um deine Frage selbst zu beantworten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1745363</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1745363</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Sat, 18 Jul 2009 15:07:59 GMT</pubDate></item><item><title><![CDATA[Reply to gesamtgröße bestimmen ? on Sat, 18 Jul 2009 16:52:02 GMT]]></title><description><![CDATA[<p>lolwurst schrieb:</p>
<blockquote>
<p>Aber wie schaffe ich es jetzt, die größe meiner Datei nur anhand des unsigned chars(indem sich der Inhalt der Datei befinded) herauszufinden ??<br />
Danke für eure Hilfe<br />
Greetz</p>
</blockquote>
<p>Hi!</p>
<p>Es geht mit <em>strlen</em>, Bedingungen:<br />
- Es befinden sich keine Nullbytes in der Datei.<br />
- Dein Puffer ist 0-initialisiert.<br />
- Dein Puffer hat mindestens ein Byte mehr als die Datei.</p>
<p>Hat die Datei Nullbytes, brauchst du ne zweite Variable zum Speichern der Dateigröße, weil <em>strlen</em> nur bis zum ersten Nullbyte zählt. Ne zweite Variable solltest du in beiden Fällen spendieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1745408</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1745408</guid><dc:creator><![CDATA[siz0r]]></dc:creator><pubDate>Sat, 18 Jul 2009 16:52:02 GMT</pubDate></item></channel></rss>