home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 17067 < prev    next >
Encoding:
Text File  |  1992-11-24  |  1.2 KB  |  31 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: <1992Nov23.212924.7733@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>
  9. Distribution: comp.lang.c
  10. Date: Mon, 23 Nov 92 21:29:24 GMT
  11. Lines: 18
  12.  
  13. In article <kf4GU6q00VQsM3GGYU@andrew.cmu.edu> rickr+@CMU.EDU (Richard Dale Romero) writes:
  14. >Probably because you're using bit-wise and instead of logical and.
  15. >In C, a zero is false and anything else is true.  There is no specification
  16.  
  17. False. 
  18.  
  19. All of the boolean operators (==, &&, and ||) are guaranteed to
  20. return 0 for false and 1 for true. There are obfuscated C contest
  21. entries that depend upon this behavior so the ANSI committee couldn't
  22. change that.
  23.  
  24.  
  25.  
  26. -- 
  27. Dave Eisen                               Sequoia Peripherals: (415) 967-5644
  28. dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
  29.        There's something in my library to offend everybody. 
  30.           --- Washington Coalition Against Censorship
  31.