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:
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: