getline()
string member function reads strings
<iomanip>
hex
, dec
, oct
int i = 135 ; cout << i << " in hex is " << hex << i << "\n"
cout << "Input a hex number: " ; cin >> hex >> i
setbase(i)
manipulator where i = 8, 10, or 16
setw(i)
i
characters to format
cout << setw(5) << 3
produces " 3"
cout << setw(1) << 123
produces "123"
setw()
is not sticky
cout << setw(4) << "a" << "b"
produces " ab"
cout << setw(4) << "a" << setw(4) << "b"
produces " a b"
setfill(c)
manipulator - use character c
as the pad
cout << setw(5) << setfill('*') << 1
produces "****1"
setfill()
is sticky
setiosflags()
manipulator - modify control bits
ios::left
- left justify output; "1 "
ios::right
- right justify output; " 1"
ios::showpoint
- output floating point with a dot and zeros
ios::skipws
- skip whitespace on input; also the ws
manipulator; this usually doesn't do what you want
ios::scientific
- output floating point in scientific notation;
also(ios::fixed
ios::uppercase
- output uppercase hex digits; also ios::lowercase
resetiosflags()
manipulator
setw()
manipulator and the width()
stream member
function
setfill()
manipulator and the fill()
stream member
function
setiosflags()
manipulator and the setf()
stream member
function - also unsetf()
This page last modified on 27 July 2001.