September 1998
Intermediate to advanced
848 pages
20h 13m
English
Structures and unions use operators to identify individual members. The membership operator is used with structures and unions, and the indirect membership operator is used with pointers to structures or unions.
. is used with a structure or union name to specify a member of that structure or union. If name is the name of a structure and member is a member specified by the structure template, then name.member identifies that member of the structure. The type of name.member is the type specified for member. The membership operator can also be used in the same fashion with unions.
struct {
int code;
float cost;
} item;
item.code = 1265;
This statement assigns a value to the code member ...
Read now
Unlock full access