Streams


The statement
cout << c1 << " + " << c2 << " = " << c3 << endl;
which is equivalent to
cout << c1; cout << " + "; cout << c2; cout << " = ";
cout << c3; cout << endl;
outputs the objects c1, c2, c3 and some string constants to the output stream cout and uses the endl manipulator which outputs a newline character and flushes the stream. If an implementation has not been provided, the compiler would reject the above statement.
Additional streams can be designed by a programmer. e.g. an object could be read from a data base stream and output to a normal output device with the statement
cdb >> x; cout << x;
As another example we could design a graphics stream and output our Vector2 objects to it.