CS 150 Introduction to C++ Programming - Spring 1998 |
|---|
[ Home | Lecture Notes| WebTutor | WebTutor Site Map]
Standard input is extracted
cin, the standard input stream using the extraction
operator (>>).
When inputting a number, the extraction operator will
"search" for the number by skipping over any leading whitespace
(blanks and end of lines).
Input stops when an inappropriate character for that number type
is found.
Thus >> reads only as many characters from cin as
are needed to form a number.
Any characters after the number (including the character that
stopped the input) are still available for the next input
operation.
(see pages 133-138 in the textbook).