Chapter 13. C++ I/O Stream Classes
One of the first innovations introduced in C++ was the use of stream classes and objects to perform input and output. These classes replace the old C-language functions printf, scanf, and so on. The latter are still supported for backward compatibility, but the more objected-oriented approach—using cin, cout, and the stream classes—offers many advantages.
Not only are the stream classes easier to use than C I/O functions, but they are also more extensible. By overloading the stream I/O operators, for example, you can make stream objects work smoothly with any types.
Another advantage is that all the operations and functions used for console input/output work exactly the same way with file objects and strings: ...