ostream& operator<< (ostream&, bool)

Alexandre Oliva oliva@dcc.unicamp.br
Sun Apr 12 21:51:00 GMT 1998


Gabriel Dos Reis writes:

> shouldn't the output be looks like 

> true
> false

> instead of

> 1
> 0

Not actually.  This is controlled by the std::boolalpha ios
manipulator, which is not implemented yet.  The default behavior is to 
use the numeric format.  In order to get the alphanumeric boolean
representation, you'd have to use:

cout << boolalpha << true << endl << false << endl;

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil




More information about the Gcc mailing list