O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

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

Stream Classes

Generally speaking, the stream classes all operate in the same manner. They can be used to extract data from or to a stream by parsing a collection of tokens. These tokens are one or more of the following:

  • Constants

  • Variables

  • Modifiers

Each item in the stream is separated by an operator, which indicates the direction of the extraction. In this way, you can read from and write to streams of data in a very flexible manner. Because the various streams are represented by classes, you can also derive your own stream classes from the base stream classes to handle user-defined data.

Note that cin and cout are actually objects; they are instances of the iostream class. The most useful stream classes are as follows:

istringstreamParsing ...

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