home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!destroyer!sol.ctr.columbia.edu!ira.uka.de!rz.uni-karlsruhe.de!usenet
- From: "hans friedrich steffani" <GM08@DKAUNI2.BITNET>
- Subject: Re: Hows this for odd
- Message-ID: <1992Nov10.164225.11160@rz.uni-karlsruhe.de>
- Sender: usenet@rz.uni-karlsruhe.de (USENET 'No news is bad news' News System)
- Organization: University of Karlsruhe, Germany
- Date: Tue, 10 Nov 1992 16:42:25 GMT
- Lines: 37
-
-
-
- > From: dkeisen@leland.Stanford.EDU (Dave Eisen)
- > In article <BxGq4z.8oA@portal.hq.videocart.com> dfuller@portal.hq.videocart.co
- m
- > (Dave Fuller) writes:
- > >bena@yoyo.cc.monash.edu.au (Ben Aveling) writes:
- > >: ... ,(i==0)?TRUE:FALSE,...
- > >: Am I going mad, or is this slightly redundant ?
- > >
- > >Not at all. Depends on what TRUE & FALSE are, and what they mean to the
- > >calling function. possible that TRUE is defined as -1, FALSE as -2.
- >
- > I think using anything other that 0 for FALSE and 1 for TRUE is
- > confusing. After all, I would hope that 1 < 3 yields TRUE. And
- > for this reason, I never use TRUE and FALSE in my code; 1 and
- > 0 are quite clear enough. Besides any nonzero value is TRUE and
- > using #defines for TRUE and FALSE is going to lead *somebody*
- > to do something like:
- >
- > if (isdigit (x) == TRUE)
- better is
- if (isdigit(x) )
- but if you do not like this perhaps you can try
- if ( isdigit(x) |= FALSE)
- wich is correct if you #define FALSE 0.
-
- You really need FALSE and TRUE as a rvalue in statments
- like
- error = FALSE; /* error is boolean */
- and nowhere else.
- I think this looks better than
- error = 0; /* error is int, perhaps the number of errors */
-
- ---
- hans friedrich steffani@imbaibrs1.bau-verm.uni-karlsruhe.de
- steffani gm08@dkauni2.bitnet
-