The new material
The new material in Listing 6 is the use of the setw manipulator to set the width of each of the output columns.
int main(){
//Print the first row in the table
// consisting of two columns.
cout << setw(10) << setprecision(1)
<< fixed << 1.5;
cout << setw(12) << setprecision(3)
<< fixed << 2.2 << endl;
Listing 6
|
The use of the endl manipulator to end the current line and go the beginning of a new line is also new.