In both C++ and C, input and output are described in terms of sequences
of characters, or streams. The USL I/O Stream Library
provides the same facilities in C++ that stdio.h provides in C, but it also
has the following advantages over stdio.h:
The input or extraction (>>) operator and the output or insertion
(<<) operator are typesafe.
You can define input and output for your own types or classes by overloading
the input and output operators. This gives you a uniform way of performing
input and output for different types of data.
The input and output operators are more efficient than scanf() and printf(),
the analogous C functions defined in stdio.h. Both scanf() and printf() take
format strings as arguments, and these format strings have to be parsed at
run time. This parsing can be time-consuming. The bindings for the USL I/O
Stream output and input operators are performed at compile time, with no need
for format strings. This can improve the readability of input and output in
your programs, and potentially the performance as well.