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: <1992Nov24.032812.2072@leland.Stanford.EDU>
- Sender: news@leland.Stanford.EDU (Mr News)
- Organization: Sequoia Peripherals, Inc.
- References: <1992Nov23.164530.19214@iacd> <kf4GU6q00VQsM3GGYU@andrew.cmu.edu> <1992Nov23.212924.7733@leland.Stanford.EDU>
- Distribution: comp.lang.c
- Date: Tue, 24 Nov 92 03:28:12 GMT
- Lines: 32
-
- It was pointed out in email that my post was misleading because I
- elided too much of the original poster's article.
-
- In article <1992Nov23.212924.7733@leland.Stanford.EDU> dkeisen@leland.Stanford.EDU (Dave Eisen) writes:
- >>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.
-
- Of course the quoted part is *not* false. It is quite true. It
- also wasn't really what I was replying to.
-
- Here is a little more of the article I was responding to.
-
- >In C, a zero is false and anything else is true. There is no specification
- >for what (x == y) returns other than zero or not zero.
-
- And this is in fact false. As I said, x == y must return either
- 0 or 1. I apologize for any confusion.
-
-
-
-
- --
- 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
-