home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!stanford.edu!leland.Stanford.EDU!dkeisen
- From: dkeisen@leland.Stanford.EDU (Dave Eisen)
- Subject: Re: Multiple &'s in an if statement
- Message-ID: <1992Nov23.212924.7733@leland.Stanford.EDU>
- Sender: news@leland.Stanford.EDU (Mr News)
- Organization: Sequoia Peripherals, Inc.
- References: <1992Nov23.164530.19214@iacd> <kf4GU6q00VQsM3GGYU@andrew.cmu.edu>
- Distribution: comp.lang.c
- Date: Mon, 23 Nov 92 21:29:24 GMT
- Lines: 18
-
- In article <kf4GU6q00VQsM3GGYU@andrew.cmu.edu> rickr+@CMU.EDU (Richard Dale Romero) writes:
- >Probably because you're using bit-wise and instead of logical and.
- >In C, a zero is false and anything else is true. There is no specification
-
- False.
-
- All of the boolean operators (==, &&, and ||) are guaranteed to
- return 0 for false and 1 for true. There are obfuscated C contest
- entries that depend upon this behavior so the ANSI committee couldn't
- change that.
-
-
-
- --
- Dave Eisen Sequoia Peripherals: (415) 967-5644
- dkeisen@leland.Stanford.EDU Home: (415) 321-5154
- There's something in my library to offend everybody.
- --- Washington Coalition Against Censorship
-