Manipulators


    Setting Output Width:
  • setw(w) - sets output or input width to w; requires < iomanip > to be included.
  • width(w) - a member function of the iostream classes.

    Filling White Space:
  • setfill(ch) - fills white space in output fields with ch; requires < iomanip > to be included. fill(ch) is a member function of the iostream classes.

    Setting Precision:
  • setprecision(n) - sets the display of floating point numbers at precision n. This does not effect the way floating point numbers are handled during calculations in your program.

    Click here for Example

I/O Manipulators<< Previous
Next >>Redirection in C++

Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus


Footer1