Home Segments Index Top Previous Next

581: Mainline

At this point, you have seen many examples in which C++'s output operator, <<, displays strings and numbers. Although convenient, the examples using the output operator have one conspicuous defect: You get ragged-looking display when the widths of the items displayed vary from line to line.

In principle, you can exert control over how the output operator does its job by using various library functions that manipulate stream objects, such as the cout stream and ofstream streams. Nevertheless, many programmers find the current generation of stream-manipulation functions to be insufficiently flexible.