- Streams that write
std::cout << "Hello, world!";
- Streams that read
int n;
std::cin << n;
- Streams that do both
std::stringstream ss;
...
ss << "Hello, world!";
...
ss >> some_string;
Streams that write, read and both. We use them all the time.
The type of std::cout is std::ostream, btw.
In addition to cout, cin, the Standard defines stringstreams and
fstreams, which read/write to memory or to a file, respectively.
How do they fit into our funky hierarchy?