From: Jason Green Newsgroups: comp.os.msdos.djgpp Subject: Re: djgpp complains about boolalpha Date: Sun, 06 Feb 2000 13:03:42 +0000 Organization: Customer of Planet Online Lines: 34 Message-ID: References: <87hepf$v0k AT r02n01 DOT cac DOT psu DOT edu> <03ro9sc0e7cpef036bce65r6f0nbobib1a AT 4ax DOT com> <87ikuu$e22 AT r02n01 DOT cac DOT psu DOT edu> NNTP-Posting-Host: modem-248.indium.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news6.svr.pol.co.uk 949842650 16833 62.136.40.248 (6 Feb 2000 13:10:50 GMT) NNTP-Posting-Date: 6 Feb 2000 13:10:50 GMT X-Complaints-To: abuse AT theplanet DOT net X-Newsreader: Forte Agent 1.7/32.534 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Thanhvu Nguyen" wrote: > ansi/iso standard provides data type bool .. and boolalpha will print out > either true or false. > no header needed .. it was compiled fine under vc++ 6 > > e.g > bool boolean = false; > cout << boolalpha << boolean << endl; > > this will print "false" According to C++PL3, boolalpha is declared in Unfortunately, this does not seem to be the case with DJGPP. ;-( I have found the formatting flag _IO_BOOLALPHA in libio.h but setting this flag manually with cout.setf() has no effect so I guess that it is not yet fully implemented in GCC. For now, probably the best that can be acheived is to define a conversion function: #include using namespace std; const char *bool_to_alpha(bool b){return(b?"true":"false");} int main() { bool boolean = false; cout << bool_to_alpha(boolean) << endl; return 0; }