boolalpha/noboolalpha
stream manipulator
ios_base& boolalpha ( ios_base& str );
ios_base& noboolalpha ( ios_base& str );
ios_base
  cplusplus.com  

Set/Unset boolalpha format flag
  boolalpha sets the format flag to insert/extract bool objects as names (true or false).
  noboolalpha unsets this flag, being bool objects inserted/extracted as standard integer values.

Parameters.

str
Stream object where to apply. This is a manipulator parameter.

Return Value.
  A reference to the stream object.

Example.

// modify boolalpha flag
#include <iostream>
using namespace std;

int main () {
  bool b;
  b=true;
  cout << boolalpha << b << endl;
  cout << noboolalpha << b << endl;
  return 0;
}
The execution of this example shall display:
  true
  1

See also.
  flags, setf, unsetf
  ios_base class


© The C++ Resources Network, 2001