Search code examples
c++c++11ostreamistream

Aren't the words ostream and istream switched in the text below?


I'm trying to understand I/O Streams in more detail, and for this, I'm reading the "The C++ Programming Language" by Stroustrup, 4th edition. Right at the beginning of Chapter 38, page 1073, one finds the following two statements:

An ostream converts typed objects to a stream of characters (bytes).

enter image description here

An istream converts a stream of characters (bytes) to typed objects.

enter image description here

Aren't the words ostream and istream switched in the explanation given above?


Solution

  • No. ostream "outputs" from arbitrary types to character sequences, and istream "inputs" to arbitrary types from character sequences, just as described.