Combining Input and Output of Different Types

The I/O Stream Classes overload the input (>>) and output (<<) operators for the built-in types. As a result, you can combine input or output of values with different types in a single statement without having to state the type of the values. For example, you can code an output statement such as:

   cout << aFloat << " " << aDouble << "\n" << aString << endl;

without needing to provide type or formatting information for each output.