All these, sometimes pretty long, << foo << bar stream expressions are really confusing if it is not clear to the reader what each of them does. Therefore, let's have a look at a table of existing formatting modifiers. They are all to be placed in a input_stream >> modifier or output_stream << modifier expression and then affect the following input or output:
| Symbol | Meaning |
| setprecision(int n) | Sets the precision parameter when printing or parsing floating-point values. |
| showpoint / noshowpoint |
Enables or disables the printing of the decimal point of floating-point numbers even if they do not have any decimal places. |
| fixed / scientific / hexfloat / defaultfloat | Numbers can be printed in a fixed style (which is the most intuitive one) or scientific style. fixed and scientific stand for these modes. hexfloat activates both modes, which formats floating-point numbers in hexadecimal floating-point notation. defaultfloat deactivates both modes. |
| showpos / noshowpos | Enable or disable printing a '+' prefix for positive floating-point values. |
| setw(int n) | Read or write exactly n characters. When reading, this truncates the input. When printing, padding is applied if the output would be shorter than n characters. |
| setfill(char c) | When applying padding (see setw), fill the output with character values, c. The default is space (' '). |
| internal / left / right | left and right control where the padding for fixed-width prints (see setw) occurs. internal puts padding characters in the middle between integers and their negative sign, the hex prefix and a hexadecimally printed value, or monetary units and values. |
| dec / hex / oct | Integral values can be printed and parsed in the decimal, hexadecimal, and octal base systems. |
| setbase(int n) | This is the numeric synonymous function to dec/hex/oct, which are equivalent if used with the values 10/16/8. Other values reset the base choice to 0, which leads to decimal printing again, or parsing based on the prefix of the input. |
| quoted(string) | Prints string in quotes or parse from quoted input, and then drops the quotes. string can be a String class instance or a C-style character array. |
| boolalpha / noboolalpha | Prints or parses Boolean values as/from alphabetical representation rather than 1/0 strings. |
| showbase / noshowbase | Enables or disables base-prefixes when printing or parsing numbers. For hex, this is 0x; for octal it is 0. |
| uppercase / nouppercase | Enables or disables upper casing or alphabetical characters when printing floating-point and hexadecimal values. |
The best way to get familiar with those is studying their variety a bit and playing with them.
When playing with them, however, we might have noticed already that most of these modifiers appear to be sticky and a few of them, not so. Sticky means that once applied, they appear to influence the input/output forever until they are reset again. The only non-sticky ones from this table are setw and quoted. They only affect the next item in the input/output. This is important to know because if we print some output with certain formatting, we should tidy up our stream object formatting settings afterward, because the next output from unrelated code may otherwise look crazy. Same applies to input parsing, where things can break with the wrong I/O manipulator options.
We did not really use any of those because they do not have to do anything with formatting, but for the reason of completeness, we should also have a look at some other stream state manipulators:
| Symbol | Meaning |
| skipws / noskipws | Enables or disables the feature of input streams skipping whitespace |
| unitbuf / nounitbuf | Enables or disables immediate output buffer flushing after any output operation |
| ws | Can be used on input streams to skip any whitespace at the head of the stream |
| ends | Writes a string-terminating '' character into a stream |
| flush | Immediately flushes out whatever is in the output buffer |
| endl | Inserts a 'n' character into an output stream and flushes the output |
From these, only skipws/noskipws and unitbuf/nounitbuf appear sticky.