【正文】
can be defined in one statement struct {int month。 int day。 int year。} birth, current。 ? Common to list the form of the structure with no following variable names – The list of structure members must be preceded by a userselected structure type name struct Date { int month。 int day。 int year。 }。 A First Book of ANSI C, Fourth Edition 10 By convention the first letter of userselected structure type names is uppercase Single Structures (continued) A First Book of ANSI C, Fourth Edition 11 Single Structures (continued) ? Initialization of structures follows the same rules as for the initialization of arrays: – struct Date birth = {12, 28, 1987}。 ? Structure members can be of any data type struct PayRecord { char name[20]。 int idNum。 double regRate。 double otRate。 }。 struct PayRecord employee = {H. Price, 12387, , }。 A First Book of ANSI C, Fourth Edition 12 Single Structures (continued) ? Advantage of structures is when the same structure type is used in a list many times ? Individual members can be arrays and structures struct { char name[20]。 struct Date birth。 } person。 – Example: [4] A First Book of ANSI C, Fourth Edition 13 Arrays of Structures A First Book of ANSI C, Fourth Edition 14 Arrays of Structures (continued) A First Book of ANSI C, Fourth Edition 15 Inner braces are not necessary Arrays of Structures (continued) A First Book of ANSI C, Fourth Edition 16 Arrays of Structures (continued) ? Without explicit initializers, the