home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / c / 16249 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.4 KB  |  37 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!kirk!ptcburp!michi
  3. From: michi@ptcburp.ptcbu.oz.au (Michael Henning)
  4. Subject: Re: How to use 'return' in c?
  5. Message-ID: <1992Nov10.035834.14396@ptcburp.ptcbu.oz.au>
  6. Organization: Pyramid Technology Corporation
  7. References: <1992Nov7.122126.24409@druid.uucp> <gm5XTB3w165w@quest.UUCP>
  8. Date: Tue, 10 Nov 1992 03:58:34 GMT
  9. Lines: 26
  10.  
  11. kdq@quest.UUCP (Kevin D. Quitt) writes:
  12.  
  13. >    On the other hand, since C does not truly support the boolean type,
  14. >I consider it misleading to assign a numeric value to a boolean.  I
  15. >define TRUE as (1==1) because the result of this is a boolean - the
  16. >fact that it is represented by a numerical value is misleading.
  17.  
  18. No. To be *really* sure you have to use
  19.  
  20. #define    TRUE    (atoi("1") == atoi("1"))
  21.  
  22. This is to make sure that the symbolic names and the underlying
  23. representation (2's complement vs 1's complement) are clearly separated.
  24. This enhances portability and makes the code easier to maintain.
  25.  
  26.  
  27.                     Michi,
  28.  
  29.                     with a :-) for the humour impared.
  30.  
  31. PS: Kevin, a look at the FAQ would have helped to prevent your posting.
  32. -- 
  33.       -m------- Michael Henning                 +61 75 950255
  34.     ---mmm----- Pyramid Technology              +61 75 722475 FAX
  35.   -----mmmmm--- Research Park, Bond University  michi@ptcburp.ptcbu.oz.au
  36. -------mmmmmmm- Gold Coast, Q 4229, AUSTRALIA   uunet!munnari!ptcburp.oz!michi
  37.