From: "Ross Axe" Newsgroups: comp.os.msdos.djgpp References: <20010418005914 DOT 7485 DOT qmail AT web13308 DOT mail DOT yahoo DOT com> <3add4e25 DOT 65909932 AT news DOT dingoblue DOT net DOT au> Subject: Re: bool type Lines: 34 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Fri, 20 Apr 2001 00:58:25 +0100 NNTP-Posting-Host: 62.255.48.24 X-Complaints-To: abuse AT virgin DOT net X-Trace: news6-win.server.ntlworld.com 987726997 62.255.48.24 (Fri, 20 Apr 2001 01:36:37 BST) NNTP-Posting-Date: Fri, 20 Apr 2001 01:36:37 BST Organization: Virgin Net Usenet Service To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "echo 'Rudolf Polzer'>/dev/null" wrote in message news:slrn9dtk7r DOT 9of DOT rpolzer AT www42 DOT t-offline DOT de... > Jack Klein wrote: > > The 1999 update to the C standard added a new type called _Bool (the > > combination of leading underscore and upper case letter puts it in the > > namespace reserved for the implementation) which is similar, but not > > identical to, the C++ type bool. > > > > If you include the C99 standard header , it defines the > > four macros bool, true, false, and __bool_true_false_are_defined. > > > > If your gcc version supports _Bool, you can use this type without > > including any header. If it supports _Bool and comes with the header > > (or you can make your own , it's a pretty > > simple header), then you can use the C99 macro bool. > > Isn't this a valid stdbool.h (without the include guards) > > typedef bool int; > #define true 1 > #define false 0 > > or is a boolean more than that? I would say so. bool (or _Bool) can hold one of two values, 0 or 1. int can hold considerably more :-) Dont know if 'typedef bool int;' is permitted by the C99 standard though. It may be. I am fairly certain that you are free to undefine and redefine the macros bool, true & false. So merely including the line 'typedef bool int;' in your program is legal, if you don't #include or you #undef bool afterwards. Ross