 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
It
is tempting when overloading these operators to include
|
|
prompts
and formatting.
|
|
|
| • |
This
should be avoided. Just imagine how awkward our
|
|
|
programs
would be if every time we read an int or a float
|
|
|
the
extraction operator would first display a prompt. It
|
|
|
would
be impossible for the prompt to be meaningful to
|
|
|
all
possible applications.
|
|
|
| • |
Plus,
what if the input was redirected from a file? Instead,
|
|
|
the
extraction operator should perform input consistent
|
|
|
with
the built-in types.
|
|
|
| • |
When
we read any type of data, prompts only occur if we
|
|
|
explicitly
write one out (e.g., cout
<<"Please enter...").
)
|
|