What is a Stream?
A stream is a flow of characters (or other kind of data)
If the flow is into your program, the stream is called an input stream
If the flow is out of your program, the stream is called an output stream
Although you may not have realized it, you’ve already been using streams in your program:
- cin is an input stream connected to the keyboard (stdin)
- cout is an output stream connected to the screen (stdout)
-
We’ll show how extend the use of streams to perform file i/o