Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>manipulators i/o setting manipulators</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Manipulators         I/O Setting Manipulators


            The manipulators are predefined words that you can pass to
    cin, cout, cerr, or clog to change the formatting of the data to
    follow. For example, hex is a manipulator and cout<<hex; changes
    stdout to hexadecimal format (include IOMANIP.H). Here are the
    manipulators and their uses:

  dec                outs<<dec or ins>>dec   Sets decimal conversion flag.
  hex                outs<<dec or ins>>dec   Sets hex conversion flag.
  oct                outs<<dec or ins>>dec   Sets octal conversion flag.
  ws                 ins>>ws                 Remove whitespace chars.
  endl               outs<<endl              Insert newline, flush stream.
  ends               outs<<ends              Insert null to end string.
  flush              outs<<flush             Flush an output stream.
  setbase(int)       outs<<setbase(nn)       Set conversion base to nn.
  resetioflags(long) ins>>resetioflags(ll)   Clear format bits in the
                            or                  streams as indicated by ll.
                     outs<<resetioflags(ll)
  setfill(int)       ins>>setfill(nn)        Set fill character to nn.
                            or
                     outs<<setfill(nn)
  setprecision(int)  ins>>setprecision(nn)   Set precision to nn digits.
                            or
                     outs<<setprecision(nn)
  setw(int)          ins>>setw(nn)           Set field width to nn.
                            or
                     outs<<setw(nn)

See Also: Formatting

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson