First page Back Continue Last page Graphics
Formatting (manipulators)
Practice : Prata manip.cpp
See table 17.3, page 891 for some standard ones.
Just put them in the output stream.
- cout << hex << 123 << endl;
- // outputs 7b
Or call them.
- cout.fill('$'); cout.width(5); cout << 123 << endl;
- // outputs $$123
They change a state and persist until they are changed.
#include <iomanip>