Input in C++

Input in C++ - Input in C+ streams pouring in > Extraction...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Input in C++ streams pouring in
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
>> Extraction operator handles all types of variables syntax: stream name >> variable (>> variable >> variable); semantics skip white space in buffer check type of non-whitespace data against variable type store data from buffer into variable, NOT whitespace stop when see white space again
Background image of page 2
Whitespace Characters Include . . . blanks tabs end-of-line (newline) characters The newline character is created for INPUT by hitting Enter or Return at the keyboard, or for OUTPUT by using the manipulator endl or “\n” in an output statement 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Extraction Operator >> >> does not read or store any trailing white space or newlines Leaves the buffer pointer on the first white space it sees after getting data 4 0
Background image of page 4
Specialized functions get only reads characters getline only reads strings ignore doesn't store data in a variable
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
the get function syntax: is a method of input streams so cin.get(ch);
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/13/2011 for the course CS 115 taught by Professor Staff during the Fall '08 term at Kentucky.

Page1 / 16

Input in C++ - Input in C+ streams pouring in > Extraction...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online