【正文】
s, and pointers may be members of unions A First Book of ANSI C, Fourth Edition 29 Unions (continued) struct { char uType。 union { char *text。 double rate。 } uTax。 } flag。 ? rate is referenced as ? The first character of the string whose address is stored in the pointer text is accessed as * A First Book of ANSI C, Fourth Edition 30 Common Programming Errors ? Attempting to use structures and unions, as plete entities, in relational expressions ? Assigning an incorrect address to a pointer that is a member of a structure or union ? Storing one data type in a union and accessing it by the wrong variable name can result in an error that is particularly troublesome to locate A First Book of ANSI C, Fourth Edition 31 Common Compiler Errors A First Book of ANSI C, Fourth Edition 32 Summary ? A structure allows individual variables to be grouped under a mon variable name ? A structure type name can be used to create a generalized structure type describing the form and arrangement of elements in a structure ? Structures are particularly useful as elements of arrays A First Book of ANSI C, Fourth Edition 33 Summary (continued) ? Individual members of a structure are passed to a function in the manner appropriate to the data type of the member being passed ? Structure members can be any valid C data type, including structures, unions, arrays, and pointers ? Unions are declared in the same manner as structures A First Book of ANSI C, Fourth Edition 34