Program Input Using cin
- >> is a binary infix operator that needs the source of the extraction (the stream) on the left side and the destination (a variable) on the right
- White space (space, tab, newline) determines where one input ends and another starts (for numeric input)
- White space at the beginning (leading white space) is ignored
- The data entered must be the same type as the destination variable
- A reader marker (bookmark) keeps track of which character is next to be read (scanned)
- Pressing the return key (enter key) causes a newline to be put into the stream (white space) and also signals cin to start reading (scanning) the input
Next page
Previous page
Go to Lesson 4 index.