Initializing arrays of structures at declaration

If the typeName or the structName have already been defined:

Syntax

typeName arrayName[n] = {{list1}, ..., {listn}};
// or
struct structName arrayName[n] = {{list1}, ..., {listn}};

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}};