<?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[Array ab bestimmter Stelle mit Daten füllen]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie kann ich diesen Code besser und übersichtlicher schreiben:</p>
<pre><code class="language-cpp">[code]
unsigned char RasBuff[4096];
int i;

i = 0;

RasBuff[i++] = 0x01; // RasBuff wird mit 2 Zeichen vorbesetzt
RasBuff[i++] = 0x02;

//....................................

RasBuff[i++] = 0xA0; // Ab dem 3. Zeichen soll RasBuff mit z.B. 30 Bytes 
RasBuff[i++] = 0xA1; // gefüllt werden
// &quot;            &quot;
RasBuff[i++] = 0xC0;

//....................................
[/code]
</code></pre>
<p>Vielen Dank für eure Hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/147068/array-ab-bestimmter-stelle-mit-daten-füllen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 02:41:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147068.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 13 May 2006 14:55:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Array ab bestimmter Stelle mit Daten füllen on Sat, 13 May 2006 14:55:20 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie kann ich diesen Code besser und übersichtlicher schreiben:</p>
<pre><code class="language-cpp">[code]
unsigned char RasBuff[4096];
int i;

i = 0;

RasBuff[i++] = 0x01; // RasBuff wird mit 2 Zeichen vorbesetzt
RasBuff[i++] = 0x02;

//....................................

RasBuff[i++] = 0xA0; // Ab dem 3. Zeichen soll RasBuff mit z.B. 30 Bytes 
RasBuff[i++] = 0xA1; // gefüllt werden
// &quot;            &quot;
RasBuff[i++] = 0xC0;

//....................................
[/code]
</code></pre>
<p>Vielen Dank für eure Hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057098</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057098</guid><dc:creator><![CDATA[WoWe]]></dc:creator><pubDate>Sat, 13 May 2006 14:55:20 GMT</pubDate></item><item><title><![CDATA[Reply to Array ab bestimmter Stelle mit Daten füllen on Sat, 13 May 2006 15:02:14 GMT]]></title><description><![CDATA[<p>So richtig weiß ich nicht, worauf du hinaus willst. Kannst du von den Werten her keine Schleife machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057103</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057103</guid><dc:creator><![CDATA[DarthZiu]]></dc:creator><pubDate>Sat, 13 May 2006 15:02:14 GMT</pubDate></item><item><title><![CDATA[Reply to Array ab bestimmter Stelle mit Daten füllen on Sat, 13 May 2006 15:02:30 GMT]]></title><description><![CDATA[<p>WoWe schrieb:</p>
<blockquote>
<p>Hallo,<br />
RasBuff[i++] = 0x01; // RasBuff wird mit 2 Zeichen vorbesetzt<br />
RasBuff[i++] = 0x02;</p>
<p>//....................................</p>
<p>RasBuff[i++] = 0xA0; // Ab dem 3. Zeichen soll RasBuff mit z.B. 30 Bytes<br />
RasBuff[i++] = 0xA1; // gefüllt werden<br />
// &quot; &quot;<br />
RasBuff[i++] = 0xC0;<br />
//....................................</p>
<p>// mahcs doch zB so:<br />
for(int j = i; j &lt; i +30; j++)<br />
RasBuff[j] = j - i + 0xA0;<br />
[/code][/cpp]</p>
<p>Vielen Dank für eure Hilfe!</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1057104</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057104</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Sat, 13 May 2006 15:02:30 GMT</pubDate></item><item><title><![CDATA[Reply to Array ab bestimmter Stelle mit Daten füllen on Sat, 13 May 2006 15:20:49 GMT]]></title><description><![CDATA[<p>War ein dummes Beispiel von mir <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    />. Die Zeichen sind willkürlich, d.h. ich kann keine Schleife verwenden. Ich hatte an sowas wie eine Initialisierung gedacht:</p>
<p>RasBuff[ab Stelle 2] = {0xa0, 0xb3, 0x2a ...... etc.};<br />
i += 30;</p>
<p>Gruß WoWe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057123</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057123</guid><dc:creator><![CDATA[WoWe]]></dc:creator><pubDate>Sat, 13 May 2006 15:20:49 GMT</pubDate></item><item><title><![CDATA[Reply to Array ab bestimmter Stelle mit Daten füllen on Sat, 13 May 2006 15:22:47 GMT]]></title><description><![CDATA[<p>du kannst ein zweites array ab stelle 0 mit diesen willkürlichen daten füllen und dann mittels memcpy die daten in das zu füllende array an eine beliebiuge stelle übertragen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057125</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057125</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Sat, 13 May 2006 15:22:47 GMT</pubDate></item><item><title><![CDATA[Reply to Array ab bestimmter Stelle mit Daten füllen on Sat, 13 May 2006 15:32:28 GMT]]></title><description><![CDATA[<p>Hallo Maxi,</p>
<p>danke, dass mit memcpy werde ich mal ausprobieren.</p>
<p>Gruß WoWe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057131</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057131</guid><dc:creator><![CDATA[WoWe]]></dc:creator><pubDate>Sat, 13 May 2006 15:32:28 GMT</pubDate></item></channel></rss>