home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_07 / 1107106a < prev    next >
Text File  |  1993-05-04  |  411b  |  22 lines

  1. // adjust.cpp:  Justify output
  2. #include <iostream.h>
  3. #include <iomanip.h>
  4.  
  5. main()
  6. {
  7.     cout << '|' << setw(10) << "hello" << '|' << endl;
  8.  
  9.     cout.setf(ios::left,ios::adjustfield);
  10.     cout << '|' << setw(10) << "hello" << '|' << endl;
  11.  
  12.     cout.fill('#');
  13.     cout << '|' << setw(10) << "hello" << '|' << endl;
  14.     return 0;
  15. }
  16.  
  17. // Output
  18. // |     hello|
  19. // |hello     |
  20. // |hello#####|
  21.  
  22.