Why is this?

You have to #include as well as #include when you use a line of code such as
```
cout << setw(8) << 123456 << endl;
```
but not have to #include when you do the exact equivalent thing in
```
cout.width(8);
cout << 123456 << endl;
```

Use of cout << setw(8) uses a manipulator that is not declared in iostream, but is declared in include iomanip. The member function cout.width(int) is already declared in iostream. There is no need to #include with the use of the member function. Manipulators are more convenient which is why they are provided.

Computer Science & Information Technology

You might also like to view...

A statement which checks to see if the value of the expression on the left side is the same as the value of the expression on the right side is an example of the use of the __________ operator.

Fill in the blank(s) with correct word

Computer Science & Information Technology

What is the most typical laptop screen size?

A. 20" - 30" B. over 30" C. 9" - 10" D. 15" - 17"

Computer Science & Information Technology