<?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[datei als hexcode speichern!]]></title><description><![CDATA[<p>hi,</p>
<p>ist es möglich eine datei als hexcode zB. in einer char variable zu speichern, und später wieder zu einer richtigen datei zu speichern?</p>
<p>hexcode:</p>
<pre><code>BE7E10410000000000000000E0000F010B01070A00F601000026040000000000565000000010000000F001000000D04A001000000002000005000100050001000400000000000000004006000004000077B8060003000080000010000000100000001000001000000000000010000000000000000000000000F601005000000000E00300B05A020000000000000000000000000000000000000000000000
</code></pre>
<p>mfg</p>
<p>dein freund</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/174449/datei-als-hexcode-speichern</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 18:15:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/174449.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Feb 2007 12:54:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to datei als hexcode speichern! on Tue, 27 Feb 2007 12:54:58 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>ist es möglich eine datei als hexcode zB. in einer char variable zu speichern, und später wieder zu einer richtigen datei zu speichern?</p>
<p>hexcode:</p>
<pre><code>BE7E10410000000000000000E0000F010B01070A00F601000026040000000000565000000010000000F001000000D04A001000000002000005000100050001000400000000000000004006000004000077B8060003000080000010000000100000001000001000000000000010000000000000000000000000F601005000000000E00300B05A020000000000000000000000000000000000000000000000
</code></pre>
<p>mfg</p>
<p>dein freund</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1236167</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1236167</guid><dc:creator><![CDATA[dein  freund]]></dc:creator><pubDate>Tue, 27 Feb 2007 12:54:58 GMT</pubDate></item><item><title><![CDATA[Reply to datei als hexcode speichern! on Tue, 27 Feb 2007 13:00:37 GMT]]></title><description><![CDATA[<p>In ein char passt dieser Text bestimmt nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Aber du kannst jeweils zwei Hex-Ziffern lesen und in eine Zahl umwandeln (und wieder zurück):</p>
<pre><code class="language-cpp">vector&lt;unsigned char&gt; data;
fstream file;
char val[3]={0,0,0};
while(file.read(val,2))
{
  unsigned char ival = strtol(val,NULL,16);
  data.push_back(ival);
}

...

fstream file;
file&lt;&lt;setfill('0')&lt;&lt;hex;
for(int i=0;i&lt;data.size();++i)
  file&lt;&lt;setw(2)&lt;&lt;(int)data[i];
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1236169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1236169</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 27 Feb 2007 13:00:37 GMT</pubDate></item><item><title><![CDATA[Reply to datei als hexcode speichern! on Tue, 27 Feb 2007 13:31:40 GMT]]></title><description><![CDATA[<p>ich hab hier n tool/programm das die datein einfach in ein grooooooßes array speichert, vll. hilft die idee weiter, weil das tool darf ich nich rausgeben</p>
<p>[EDIT] ich sag nur soviel, das tool legt eine cpp(inklusive h) file an mit einem cont unsigned char array und einer arraysizevariable und schreibt dann einfach die datei byte für byte in das array.</p>
<pre><code class="language-cpp">const long FILENAME_VERSION = 0x0000001; 
const unsigned long FILENAME_ARRAY_SIZE = xxxxxx; 
#pragma pack(push, 1) // 1 byte datenausrichtung
const unsigned char FILENAME_ARRAY[FILENAME_ARRAY_SIZE] = {
   12,36,77,0,2,0,0,0,4,0,55,0,255,255,0,
   ...
   ...   // etwa 40k zeilen
   ...
};
#pragma pack(pop) // pack pragma beenden

//----  Headerfile
extern const long FILENAME_ARRAY_VERSION;
extern const unsigned long FILENAME_ARRAY_SIZE;
extern const unsigned char FILENAME_ARRAY;
</code></pre>
<p>allerdings sollte die datei dann nciht größer als 1MB sein, das kostet schon ordentlich zeit die datei zu öffnen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1236186</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1236186</guid><dc:creator><![CDATA[Ceos]]></dc:creator><pubDate>Tue, 27 Feb 2007 13:31:40 GMT</pubDate></item><item><title><![CDATA[Reply to datei als hexcode speichern! on Wed, 28 Feb 2007 07:38:29 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-169154-and-highlight-is-0123456789abcdef.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-169154-and-highlight-is-0123456789abcdef.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1236575</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1236575</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 28 Feb 2007 07:38:29 GMT</pubDate></item></channel></rss>