O'Reilly logo

Sams Teach Yourself C++ in One Hour a Day, Sixth Edition by Bradley Jones, Siddhartha Rao, Jesse Liberty

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

Chapter 27. Working with Streams

Until now, you’ve been using cout to write to the screen and cin to read from the keyboard, without a full understanding of how they work. In this lesson, you will learn all about both of these.

You will also learn

  • What streams are and how they are used

  • How to manage input and output using streams

  • How to write to and read from files using streams

Overview of Streams

C++ defines neither how data is written to the screen or to a file, nor how data is read into a program. These are clearly essential parts of working with C++, however, and the standard C++ library includes the iostream library, which facilitates input and output (I/O).

The advantage of having the input and output kept apart from the language and handled in ...

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