<?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 Subscript Error]]></title><description><![CDATA[<p>Wenn ich versuche diesen Code</p>
<pre><code class="language-cpp">for (uint8 i = 1; i &lt;= material_size ; i++){
					for (uint8 j = 1; j &lt;= material_size ; j++){
					source.size16.alphamap[i][j] = alpha_source[i][j];
					source.size16.depthmap[i][j] = depth_source[i][j];
					source.size16.colormap[i][j] = color_source[i][j];
					source.size16.shinemap[i][j] = shine_source[i][j];
					}
					}
</code></pre>
<p>zu compilieren , dann erhalte ich folgende Fehlernachricht</p>
<p>Der Compiler schrieb:</p>
<blockquote>
<p>base.h:51: error: invalid use of 'struct material::size16'<br />
base.h:51: error: invalid types 'unsigned char[uint8]' for array subscript</p>
</blockquote>
<p>obwohl uint8 nur ein Typ unsigned int mit 8 bit ist (mit int funktioniert es auch nicht) Was habe ich falsch gemacht ? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/137275/array-subscript-error</link><generator>RSS for Node</generator><lastBuildDate>Sat, 29 Aug 2026 18:39:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/137275.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Feb 2006 13:31:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Array Subscript Error on Thu, 16 Feb 2006 13:31:50 GMT]]></title><description><![CDATA[<p>Wenn ich versuche diesen Code</p>
<pre><code class="language-cpp">for (uint8 i = 1; i &lt;= material_size ; i++){
					for (uint8 j = 1; j &lt;= material_size ; j++){
					source.size16.alphamap[i][j] = alpha_source[i][j];
					source.size16.depthmap[i][j] = depth_source[i][j];
					source.size16.colormap[i][j] = color_source[i][j];
					source.size16.shinemap[i][j] = shine_source[i][j];
					}
					}
</code></pre>
<p>zu compilieren , dann erhalte ich folgende Fehlernachricht</p>
<p>Der Compiler schrieb:</p>
<blockquote>
<p>base.h:51: error: invalid use of 'struct material::size16'<br />
base.h:51: error: invalid types 'unsigned char[uint8]' for array subscript</p>
</blockquote>
<p>obwohl uint8 nur ein Typ unsigned int mit 8 bit ist (mit int funktioniert es auch nicht) Was habe ich falsch gemacht ? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/995746</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/995746</guid><dc:creator><![CDATA[RobthaR]]></dc:creator><pubDate>Thu, 16 Feb 2006 13:31:50 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Thu, 16 Feb 2006 13:38:15 GMT]]></title><description><![CDATA[<p>Wie ist denn &quot;material::size16&quot; definiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/995752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/995752</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Thu, 16 Feb 2006 13:38:15 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Thu, 16 Feb 2006 14:19:26 GMT]]></title><description><![CDATA[<p>is ein struct size16 mit 4 zweidimensionalen array für farbinformationen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/995804</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/995804</guid><dc:creator><![CDATA[RobthaR]]></dc:creator><pubDate>Thu, 16 Feb 2006 14:19:26 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Thu, 16 Feb 2006 14:38:06 GMT]]></title><description><![CDATA[<p>RobthaR schrieb:</p>
<blockquote>
<p>is ein struct size16 mit 4 zweidimensionalen array für farbinformationen</p>
</blockquote>
<p>Poste doch mal ein <em>vollständiges</em> Minimalbeispiel.</p>
<p>Gruß Caipi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/995822</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/995822</guid><dc:creator><![CDATA[Caipi]]></dc:creator><pubDate>Thu, 16 Feb 2006 14:38:06 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Thu, 16 Feb 2006 18:07:04 GMT]]></title><description><![CDATA[<p>Mit Vergnügen</p>
<pre><code class="language-cpp">struct material {
	uint8 size_of;
	uint8 priority;
	bool lightened;
	struct size16 {
		 uint8 alphamap[16][16];
		 uint8 depthmap[16][16];
		uint16 colormap[16][16];
		 uint8 shinemap[16][16];	};
	struct size32 {
		 uint8 alphamap[32][32];
		 uint8 depthmap[32][32];
		uint16 colormap[32][32];
		 uint8 shinemap[32][32];	};
	struct size64 {
		 uint8 alphamap[64][64];
		 uint8 depthmap[64][64];
		uint16 colormap[64][64];
		 uint8 shinemap[64][64];	};
	};
</code></pre>
<p>Der Struct</p>
<pre><code class="language-cpp">void encode_material(/*sources*/material source , uint8 material_size , uint8 priority , bool light_culled , uint8 alpha_source[] , uint8 depth_source[] , uint16 color_source[] , uint8 shine_source[] ) {
			source.lightened = light_culled;
			source.priority  = priority;
			source.size_of	 = material_size;
			switch (material_size) {
				case 16:
					for (uint8 i = 1; i &lt;= material_size ; i++){
					for (uint8 j = 1; j &lt;= material_size ; j++){
					source.size16.alphamap[i][j] = alpha_source[i][j];
					source.size16.depthmap[i][j] = depth_source[i][j];
					source.size16.colormap[i][j] = color_source[i][j];
					source.size16.shinemap[i][j] = shine_source[i][j];
					}
					}
					break;
				case 32:
					for (uint8 i = 1; i &lt;= material_size ; i++){
					for (uint8 j = 1; j &lt;= material_size ; j++){
					source.size32.alphamap[i][j] = alpha_source[i][j];
					source.size32.depthmap[i][j] = depth_source[i][j];
					source.size32.colormap[i][j] = color_source[i][j];
					source.size32.shinemap[i][j] = shine_source[i][j];
					}
					}
					break;
				case 64:
					for (uint8 i = 1; i &lt;= material_size ; i++){
					for (uint8 j = 1; j &lt;= material_size ; j++){
					source.size64.alphamap[i][j] = alpha_source[i][j];
					source.size64.depthmap[i][j] = depth_source[i][j];
					source.size64.colormap[i][j] = color_source[i][j];
					source.size64.shinemap[i][j] = shine_source[i][j];
					}
					}
					break;
				}
			}
</code></pre>
<p>Die Funktion (Recht langer Funktionskopf <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="😉"
    /> )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996071</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996071</guid><dc:creator><![CDATA[RobthaR]]></dc:creator><pubDate>Thu, 16 Feb 2006 18:07:04 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Thu, 16 Feb 2006 18:46:50 GMT]]></title><description><![CDATA[<p>Tja, Du hast innerhalb der struct drei Typen deklariert namens material::size16, material::size32 und material::size64 (nested classes), nicht etwa Objekte davon.</p>
<pre><code class="language-cpp">struct material {
  struct size16 {
    /* ... */
  };
  size16 size16_elem;
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/996119</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996119</guid><dc:creator><![CDATA[LordJaxom_off]]></dc:creator><pubDate>Thu, 16 Feb 2006 18:46:50 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Thu, 16 Feb 2006 19:21:47 GMT]]></title><description><![CDATA[<p>Aaaaaaaaaachso , mist , hätt mir klar sein müssen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> Thx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996153</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996153</guid><dc:creator><![CDATA[RobthaR]]></dc:creator><pubDate>Thu, 16 Feb 2006 19:21:47 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Thu, 16 Feb 2006 19:29:17 GMT]]></title><description><![CDATA[<p>Naja , das is zwar schon richtig , aber :</p>
<p>base.h:55: error: invalid types 'unsigned char[int]' for array subscript<br />
base.h:56: error: invalid types 'unsigned char[int]' for array subscript<br />
base.h:57: error: invalid types 'short unsigned int[int]' for array subscript<br />
base.h:58: error: invalid types 'unsigned char[int]' for array subscript<br />
base.h:65: error: invalid types 'unsigned char[int]' for array subscript<br />
base.h:66: error: invalid types 'unsigned char[int]' for array subscript<br />
base.h:67: error: invalid types 'short unsigned int[int]' for array subscript<br />
base.h:68: error: invalid types 'unsigned char[int]' for array subscript<br />
base.h:75: error: invalid types 'unsigned char[int]' for array subscript<br />
base.h:76: error: invalid types 'unsigned char[int]' for array subscript<br />
base.h:77: error: invalid types 'short unsigned int[int]' for array subscript<br />
base.h:78: error: invalid types 'unsigned char[int]' for array subscript</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996157</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996157</guid><dc:creator><![CDATA[RobthaR]]></dc:creator><pubDate>Thu, 16 Feb 2006 19:29:17 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Fri, 17 Feb 2006 07:26:14 GMT]]></title><description><![CDATA[<p>die Parameter 'alpha_source' etc sind ja auch nur eindimensionale Arrays <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="😉"
    /></p>
<p>(btw ist es Verschwendung, dort drei structs zu definieren, wenn sowieso nur eins davon gleichzeitig genutzt wird)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996369</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996369</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 17 Feb 2006 07:26:14 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Fri, 17 Feb 2006 12:18:03 GMT]]></title><description><![CDATA[<p>Wenn ich im Funktionskopf zwei Array Klammern , also [][] mache , dann bekomme ich andere Fehler :</p>
<p>Mister Compiler schrieb:</p>
<blockquote>
<p>base.h:47: error: declaration of 'alpha_source' as multidimensional array must have bounds for all dimensions except the first<br />
base.h:47: error: declaration of 'depth_source' as multidimensional array must have bounds for all dimensions except the first<br />
base.h:47: error: declaration of 'color_source' as multidimensional array must have bounds for all dimensions except the first<br />
base.h:47: error: declaration of 'shine_source' as multidimensional array must have bounds for all dimensions except the first<br />
base.h: In function 'void encode_material(material, int, uint8, bool)':<br />
base.h:55: error: 'alpha_source' was not declared in this scope<br />
base.h:56: error: 'depth_source' was not declared in this scope<br />
base.h:57: error: 'color_source' was not declared in this scope<br />
base.h:58: error: 'shine_source' was not declared in this scope<br />
base.h:65: error: 'alpha_source' was not declared in this scope<br />
base.h:66: error: 'depth_source' was not declared in this scope<br />
base.h:67: error: 'color_source' was not declared in this scope<br />
base.h:68: error: 'shine_source' was not declared in this scope<br />
base.h:75: error: 'alpha_source' was not declared in this scope<br />
base.h:76: error: 'depth_source' was not declared in this scope<br />
base.h:77: error: 'color_source' was not declared in this scope<br />
base.h:78: error: 'shine_source' was not declared in this scope<br />
make: *** [arm9_main.o] Error 1</p>
</blockquote>
<p>Ich brauche statiche Werte für die Arrays , deswegen habe ich 16 32 und 64 gewählt ; ich habs auch schon mit ner Klasse versucht , aber habs net auf die reihe bekommen ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996600</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996600</guid><dc:creator><![CDATA[RobthaR]]></dc:creator><pubDate>Fri, 17 Feb 2006 12:18:03 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Fri, 17 Feb 2006 12:25:07 GMT]]></title><description><![CDATA[<p>Und was ist an &quot;mehrdimensionale Arrays müssen Grenzen (Werte) für alle Dimensionen ausser der ersten haben&quot; nicht verständlich? <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="😉"
    /></p>
<p>Oder haperts am Englischen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/27a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--right_arrow"
      title=":arrow_right:"
      alt="➡"
    /> ohne Englisch wirds schwer!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996616</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996616</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Fri, 17 Feb 2006 12:25:07 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Fri, 17 Feb 2006 12:29:24 GMT]]></title><description><![CDATA[<p>Wenn ich wüsste , wie ich diese Grenzen definiere wärs etwas einfacher</p>
<p>PS: Wusst net , was bounds sind</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996622</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996622</guid><dc:creator><![CDATA[RobthaR]]></dc:creator><pubDate>Fri, 17 Feb 2006 12:29:24 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Fri, 17 Feb 2006 12:33:30 GMT]]></title><description><![CDATA[<p>Dann mußt du statt int[][] halt geeignet initialisierte int** übergeben (in den FAQs finden sich gewiss ein paar Beispiele, wie man dynamisch Matrixstrukturen anlegt).</p>
<p>PS: eventuell kannst du statt der fixierten struct's auch solche dynamisch angelegten Felder verwenden - wenn nicht, würde ich eigentlich mit einem Doppelarray auskommen (und ungenutzte Felder leer lassen).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996626</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996626</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Fri, 17 Feb 2006 12:33:30 GMT</pubDate></item><item><title><![CDATA[Reply to Array Subscript Error on Fri, 17 Feb 2006 12:48:12 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> Hat geklappt , THX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/996646</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/996646</guid><dc:creator><![CDATA[RobthaR]]></dc:creator><pubDate>Fri, 17 Feb 2006 12:48:12 GMT</pubDate></item></channel></rss>