O'Reilly logo

C++ Primer Plus by Stephen Prata

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Other istream Class Methods

Chapters 3 through 5 discuss the get() and getline() methods. As you may recall, they provide the following additional input capabilities:

• The get(char &) and get(void) methods provide single-character input that doesn’t skip over white space.

• The get(char *, int, char) and getline(char *, int, char) functions by default read entire lines rather than single words.

These are termed unformatted input functions because they simply read character input as it is, without skipping over white space and without performing data conversions.

Let’s look at these two groups of istream class member functions.

Single-Character Input

When used with a char argument or no argument at all, the get() methods fetch the next input ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required