mikroC
mikroC - C Compiler for Microchip PIC microcontrollers
making it simple...
A structure is a derived type usually representing a
Unlike arrays, structures are considered single objects. The mikroC structure type lets you handle complex data structures almost as easily as single variables.
Note: mikroC does not support anonymous structures (ANSI divergence).
Structure Declaration and Initialization
Structures are declared using the keyword struct:
struct tag {
Here, tag is the name of the structure;
The member type cannot be the same as the struct type being currently declared. However, a member can be a pointer to the structure being declared, as in the following example:
page
74
struct | mystruct | { | mystruct | s;}; | /* | illegal! */ |
struct | mystruct | { | mystruct | *ps;}; | /* | OK */ |
Also, a structure can contain previously defined structure types when declaring an instance of a declared structure. Here is an example:
/* Structure defining a dot: */ struct Dot {float x, y;};
/* Structure defining a circle: */ struct Circle {
double r;
struct Dot center;
}o1, o2; /* declare variables o1 and o2 of circle type */
MikroElektronika: Development tools - Books - Compilers