Home Segments Index Top Previous Next

22: Mainline

The output operator, <<, also known as the insertion operator, always stands between a data-producing expression, located on the right, and a name that specifies a place to put those data on the left. When you want characters displayed on your screen, for example, you use cout as the name that specifies the place to put the data.

In the sample program, there are three output statements, each identified as such by the output operator. In the first instance, the output operator displays a character string; in C++, character strings are delimited on both ends by double-quotation marks:

cout << "The volume of the box car is ";