cvs.gedasymbols.org/archives/browse.cgi | search |
From: | G DOT A DOT Patterson AT _btinternet DOT com (Graham A. Patterson) |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: BOOL as char/int |
Date: | Tue, 13 Apr 1999 17:45:48 GMT |
Organization: | The House of Hector |
Message-ID: | <371381f1.40361166@news.btinternet.com> |
References: | <7ev4na$49a$1 AT lola DOT ctv DOT es> |
NNTP-Posting-Host: | host5-99-59-160.btinternet.com |
X-Newsreader: | Forte Free Agent 1.11/32.235 |
Lines: | 17 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
"Rafael García" <rafael AT geninfor DOT com> wrote: >typedef char /*int*/ BOOL; >#define TRUE 1 >#define FALSE 0 Well, FALSE can reasonably be assumed to be zero. But there is nothing to say (in the various standards for C, C++, or C9X) that TRUE is necessarily one. It is any non-zero number, including negative. Make tests against FALSE by all means, but testing for 'TRUE' as a specific value is asking for trouble. -- Graham Patterson http://www.btinternet.com/~g.a.patterson/ *** Unless otherwise stated, opinions expressed are mine ***
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |