May 2012
Intermediate to advanced
679 pages
16h 56m
English
The common manipulators mentioned in this chapter are summarized in Table 11.4.
Table 11.4 Manipulators
| Manipulator | Purpose/what it does |
|---|---|
| dec | Converts to decimal |
| oct | Converts to octal |
| hex | Converts to hex |
| endl | Inserts new line and flushes the output stream |
| ends | Inserts null character to terminate and output string |
| flush | Flushes the output stream |
| setw(int n) | Changes the field width for output to n |
| setfill(char n) | Changes the fill character to n (default character is space) |
| setprecision(int n) | Changes the precision to n places after the decimal point |
| setbase( base n) | Output sets the base to 8 ,10 or 16; Input uses C convention. |
| setiosflags(fmtflags n) | Sets format flags specified by n. Setting ... |
Read now
Unlock full access