Creating arrays of structures

There are two ways to create arrays of structures. If the typeName or the structName have already been defined:

Syntax

typeName arrayName[n];
// or
struct structName arrayName[n];

Code example

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