Mail Archives: djgpp/1996/06/05/03:25:44
On 28 May 1996, Eric NICOLAS wrote:
> 1. Can someone give me some info about "bool" data type. Is this a default
> type under gcc ? What are possible values (true, false, TrUe, TRUE...) ? How
> is it coded in memory (one bit, one int...). I couldn't find anything about
> that in info pages.
Mark Habersack <grendel AT ananke DOT amu DOT edu DOT pl> replied:-
> bool type is a new ANSI C++ standard data type. It is, as you might suspect,
> a boolean value (true | false) and can take two values: true | false
(0) Or define it thus:-
#define bool char /* or int or short */
enum{false=0,true=1};
but remember that true/false values returned by functions are sometimes other
non-zero values than 1 for `true' or `ran OK', so if x is an int or short or
char containing a yes/no, write if(x) or if(!x), not if(x==true) or the like.
(1) `new ... standard' hereinabove seems to say that the ANSI C++ standard is
still being altered; please what is the email address of the people in charge
of it?
- Raw text -