Next:
Implementing a User-Defined Type
Up:
week1
Previous:
Structure Definitions
Accessing Structure Members
Member access operators
Dot operator (
.
) for structure and class members
Arrow operator (
) for structure and class members via pointer to object
Print member
hour
of
timeObject
:
cout << timeObject.hour; OR timePtr = &timeObject; cout << timePtr->hour;}
timePtr
hour
same as
( *timePtr ).hour
Parentheses required,
*
lower precedence than
.
2004-06-29