topical media & game development

talk show tell print

professional-program-14-Manipulator-Manipulator.c

? / professional-program-14-Manipulator-Manipulator.c


  include <iostream>
  include <iomanip>
  
  using namespace std;
  
  int main(int argc, char** argv)
  {
    bool myBool = true;
  
    cout << "This is the default: " << myBool << endl;
    cout << "This should be true: " << boolalpha << myBool << endl;
    cout << "This should be 1: " << noboolalpha << myBool << endl;
  
    double dbl = 1.452;
    double dbl2 = 5;
  
    cout << "This should be 5: " << setw(2) << noshowpoint << dbl2 << endl;
    cout << "This should be @@1.452: " << setw(7) << setfill('@') << dbl << endl;
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.