C - Arrays of Structures3
Revision as of 06:51, 7 March 2012 by Jshankar (1 revision)
Arrays of Structures ...
struct Month* pmtab; pmtab = (struct Month*)malloc(sizeof(struct Month)*NMONTHS);
If p is a pointer to a structure, arithmetic on p takes into account the size of the structure, so p++ incrments p by the correct amount to get the next element of the array of structures.