www.lsp4you.com
C ++ Stream
C ++ Stream
continue
Extraction from
input stream
Program
Output Stream
Output device
Insertion into
output stream
C ++ Stream
continue
Input device
Program
Output Stream
Output device
Insertion into
output stream
C ++ Stream Classes
C ++ Stream Classes
continue
ios
istream
streambuf
ostream
iostream
istream_withassign
iostream_withassign
ostream_withassign
C ++ Stream Classes
Provides the facilities
for formatted and
unformatted input
ios
istream
streambuf
iostream
continue
Provides the basic
support for formatted
and unformatted I/O
operations.
ostream
Provides the
facilities for
formatted output
istream_withassign
iostream_withassign
ostream_withassign
cin.get(c)
c = cin.get( );
cout.put(x);
cout.put(c);
Manipulators
setw( )
setprecision( )
setfill( )
setiosflags( )
resetiosflags( )
cout.width(5);
cout << 543;
cout.width(5);
cout << 12 << \n;
5
cout.precision(3);
cout << sqrt(2) << endl;
cout << 3.14159 << endl;
cout <<2.50032 << endl;
1.141
3.142
2.5
truncated
rounded
o trailing zeros
cout.fill(ch);
where ch represents the character which is
used for filling the unused positions.
cout.fill( * );
cout.wdith(10);
cout << 5250 << endl;
*
cout.setf(arg1, arg2)
eg:
cout.fill( * );
cout.setf(arg1, arg2)
eg:
cout.fill( * );
Manipulators
Meaning
Equivalent
setw(int w)
width( )
setprecision(int d)
precision( )
setfill( int c)
fill( )
Thank You