home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 17091 < prev    next >
Encoding:
Text File  |  1992-11-24  |  1.7 KB  |  45 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!stanford.edu!leland.Stanford.EDU!dkeisen
  3. From: dkeisen@leland.Stanford.EDU (Dave Eisen)
  4. Subject: Re: Multiple &'s in an if statement
  5. Message-ID: <1992Nov24.032812.2072@leland.Stanford.EDU>
  6. Sender: news@leland.Stanford.EDU (Mr News)
  7. Organization: Sequoia Peripherals, Inc.
  8. References: <1992Nov23.164530.19214@iacd> <kf4GU6q00VQsM3GGYU@andrew.cmu.edu> <1992Nov23.212924.7733@leland.Stanford.EDU>
  9. Distribution: comp.lang.c
  10. Date: Tue, 24 Nov 92 03:28:12 GMT
  11. Lines: 32
  12.  
  13. It was pointed out in email that my post was misleading because I
  14. elided too much of the original poster's article.
  15.  
  16. In article <1992Nov23.212924.7733@leland.Stanford.EDU> dkeisen@leland.Stanford.EDU (Dave Eisen) writes:
  17. >>In C, a zero is false and anything else is true.  There is no specification
  18. >
  19. >False. 
  20. >
  21. >All of the boolean operators (==, &&, and ||) are guaranteed to
  22. >return 0 for false and 1 for true. There are obfuscated C contest
  23. >entries that depend upon this behavior so the ANSI committee couldn't
  24. >change that.
  25.  
  26. Of course the quoted part is *not* false. It is quite true. It
  27. also wasn't really what I was replying to.
  28.  
  29. Here is a little more of the article I was responding to.
  30.  
  31. >In C, a zero is false and anything else is true.  There is no specification
  32. >for what (x == y) returns other than zero or not zero.  
  33.  
  34. And this is in fact false. As I said, x == y must return either
  35. 0 or 1. I apologize for any confusion.
  36.  
  37.  
  38.  
  39.  
  40. -- 
  41. Dave Eisen                               Sequoia Peripherals: (415) 967-5644
  42. dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
  43.        There's something in my library to offend everybody. 
  44.           --- Washington Coalition Against Censorship
  45.