User`s manual

36 digi.com Language
4.13.2 Structure
Variables may be grouped together in structures (struct in C) or in arrays. Structures may be nested.
Structure members—the variables within a structure—are referenced using the dot operator.
The size of a structure is the sum of the sizes of its components.
4.13.3 Union
A union overlays simple or complex data. That is, all the union members have the same address. The size
of the union is the size of the largest member.
Unions can be nested. Union members—the variables within a union—are referenced, like structure ele-
ments, using the dot operator.
4.13.4 Composites
Composites of structures, arrays, unions, and primitive data may be formed. This example shows an array
of structures that have arrays as structure elements.
Refer to an element of array c (above) as shown here.
struct {
char flags;
struct {
int x;
int y;
} loc;
} cursor;
j = cursor.loc.x
union {
int ival;
long jval;
float xval;
} u;
j = u.ival
typedef struct {
int *x;
int c[32]; // array in structure
} node;
node list[12]; // array of structures
z = list[n].c[m];
...
list[0].c[22] = 0xFF37;