/* related posts with thumb nails */

IOStream Class Functions:


IOS Class
Functions  
Function  
Meaning
int ios::width()
Returns the current width
int ios::width(n)
Sets the width and Returns the
current width
int ios::fill()
Returns the current fill character
int ios::fill(n)
Sets the fill character and
Returns the current fill character
int ios::precision()
Returns the current floating
point precision
int ios::precision(n)
Sets the floating point precision
and Returns the current floating
point precesion


Example:
main()
{
     char x[]=“hello”;
cout.fill(‘*’);
cout.width(10);
cout<<x;   // prints “*****hello”

float f=3.456;
cout.precesion(2);      
cout<<f;    // prints 3.46
}
Related Topics:

0 comments:

Post a Comment