Using arrays of structures

If the arrayName has already been defined:

Syntax

arrayName[n].memberName

Code example

// structure type to handle color values
typedef struct {
    int red;
    int green;
    int blue;
} rgb;
...
rgb aColor[2] = {{0, 0, 0}, {255, 255, 255}};

int main (void) {
    aColor[0].red   = 0;
    aColor[0].green = 145;
    aColor[0].blue  = 189;
    ...
}