Next:
Implementing a User-Defined Type
Up:
Introduction, Classes and Data
Previous:
Structure Definitions
Contents
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-07-29