Manipulators are values that you can insert into or extract from iostreams to have special effects.
Parameterized manipulators are manipulators that take one or more parameters.
Because manipulators are ordinary identifiers and therefore use up possible names, iostream does not define them for every possible function. A number of manipulators are discussed with member functions in other parts of this chapter.
The 13 predefined manipulators are described in the following table. This table assumes the following:
i has type long.
n has type int.
c has type char.
istr is an input stream.
ostr is an output stream.
To use predefined manipulators, you must include the file iomanip.h in your program.
You can define your own manipulators. The two basic types of manipulators are:
Plain manipulator – Takes an istream&, ostream&, or ios& argument, operates on the stream, and then returns its argument.
Parameterized manipulator – Takes an istream&, ostream&, or ios& argument, one additional argument (the parameter), operates on the stream, and then returns its stream argument.