www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/05/03:25:44

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Organization: Materials Science Centre
To: DJGPP AT DELORIE DOT COM
Date: Wed, 5 Jun 1996 08:18:03 GMT
Subject: Re: bool
Message-ID: <20C58544781@fs2.mt.umist.ac.uk>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019