mikroC
making it simple...
mikroC - C Compiler for Microchip PIC microcontrollers
An array is
Multidimensional arrays are constructed by declaring arrays of array type. These arrays are stored in memory in such way that the right most subscript changes fastest, i.e. arrays are stored “in rows”. Here is a sample
float m[50][20]; /*
Variable m is an array of 50 elements, which in turn are arrays of 20 floats each. Thus, we have a matrix of 50x20 elements: the first element is m[0][0], the last one is m[49][19]. First element of the 5th row would be m[0][5].
If you are not initializing the array in the declaration, you can omit the first dimension of
int a[3][2][4]; /*
void func(int n[][2][4]) { /* we can omit first dimension */ //...
n[2][1][3]++; /* increment the last element*/ }//~
void main() {
//...
func(a);
}//~!
You can initialize a
int a[3][2] = {{1,2}, {2,6}, {3,7}};
|
| page |
MikroElektronika: Development tools - Books - Compilers | 67 | |
|