1. ## Arrays

Just a quick question about multidemintional arrays, i understand that when i create them i can put values into them with = {values} however is there anyway to put the values in them the sameway after ive created them (without a loop of somekind)?

Heres the code ive got, FONTHEIGHT and FONTWIDTH are #defines of 8 and 4. chr is just an int.
Code:
```         int FontArray[FONTHEIGHT][FONTWIDTH];
switch (chr)
{
// H
case 72: FontArray[][] = { {1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 1, 1, 1 },
{1, 1, 1, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 }}; break;
default: FontArray[][] = { {1, 1, 1, 1 },
{1, 1, 1, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 1, 1, 1 }}; break;
}```

2. ## Re: Arrays

Originally posted by H3g3m0n
however is there anyway to put the values in them the sameway after ive created them (without a loop of somekind)?
No.

3. You could always use pointers...
Code:
```#include <stdio.h>
#include <stdlib.h>

#define FONTHEIGHT 8
#define FONTWIDTH  4

int main ( int argc, char *argv[] ) {
int FontArrays[2][FONTHEIGHT][FONTWIDTH] = {
{
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 1, 1, 1 },
{1, 1, 1, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 }
},
{
{1, 1, 1, 1 },
{1, 1, 1, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 0, 0, 1 },
{1, 1, 1, 1 }
},
};
int r, c;
int chr = 72;
int (*fontptr)[FONTWIDTH];
switch (chr)
{
case 72: fontptr = FontArrays[0]; break;
default: fontptr = FontArrays[1]; break;
}
for ( r = 0 ; r < FONTHEIGHT ; r++ ) {
for ( c = 0 ; c < FONTWIDTH ; c++ ) {
printf( "%d", fontptr[r][c] );
}
printf( "\n" );
}
return 0;
}```

4. Thanks, I guess ill probally have to find some otherway of retreving them, pointers probally wouldn't work as i would need atleast although many numbers would be returning the same array.

5. > although many numbers would be returning the same array.
Like

case 72: case 73: case 74: case 75: fontptr = FontArrays[0]; break;

In fact, why not just go for it and say
fontptr = FontArrays[chr];