Actions

EmSys

C - Arrays of Structures

From EdWiki

Revision as of 09:30, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Arrays of Structures

The structure declaration

struct Month {
    char* name;
    int days;
}MonthTab[NMONTHS];

Declares a structure type Month, defines an array MonthTab of structures of this type, and sets aside storage for them.

Each element of the array is a structure.

This could also be written as