C++ Std Manipulators
Manipulators are helper function which can be used for formatting input and output data. Manipulators specifically designed to be used in conjunction with the insertion (<<) and extraction (>>) operators on stream objects, for example:
- The iostream.h and iomanip.h header file has several pre-defined manipulators.
Basic format flags
Independent flags (switch on)
Independent flags (switch off)
Numerical base format flags ("basefield" flags)
dec |
Use decimal base. |
hex |
Use hexadecimal base |
oct |
Use octal base. |
Floating point format flags ("floatfield" flags)
fixed |
Use fixed floating point notation. |
scientific |
Use scientific floating point notation. |
Adjustment format flags ("adjustfileld "flags)
internal |
Sets field by inserting characters at an internal position. |
left |
Adjust output to the left. |
right |
Adjust output to the right. |
Input manipulators
Output manipulators
endl |
Insert newline and flush. |
ends |
Insert null characters. |
flush |
Flush stream buffer. |
Parameterized manipulators
These functions take parameters when used as manipulators. They require inclusion of <iomanip> header file.
|