mikroC
making it simple...
DERIVED TYPES
mikroC - C Compiler for Microchip PIC microcontrollers
The derived types are also known as structured types. These types are used as elements in creating more complex
Arrays
Array is the simplest and most commonly used structured type. Variable of array type is actually an array of objects of the same type. These objects represent elements of an array and are identified by their position in array. An array consists of a contiguous region of storage exactly large enough to hold all of its elements.
Array Declaration
Array declaration is similar to variable declaration, with the brackets added after identifer:
type
This declares an array named as array_name composed of elements of type. The type can be scalar type (except void),
Each of the elements of an array is numbered from 0 through the number of elements minus one. If the number is n, elements of array can be approached as variables array_name[0] ..
Here are a few examples of array declaration:
#define MAX = 50 |
|
|
|
|
|
|
| |
int vector_one[10]; | /* an array of 10 | integers */ | ||||||
float | vector_two[MAX]; | /* | an | array | of | 50 | floats | */ |
float | vector_three[MAX - 20]; | /* | an | array | of | 30 | floats | */ |
MikroElektronika: Development tools - Books - Compilers
page
65