home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!ames!sun-barr!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!mksol!mccall
- From: mccall@mksol.dseg.ti.com (fred j mccall 575-3539)
- Subject: Re: How to use 'return' in c?
- Message-ID: <1992Nov12.164143.6336@mksol.dseg.ti.com>
- Organization: Texas Instruments Inc
- References: <1992Nov9.190838.3391@mksol.dseg.ti.com> <7162TB3w165w@quest.UUCP>
- Date: Thu, 12 Nov 1992 16:41:43 GMT
- Lines: 29
-
- In <7162TB3w165w@quest.UUCP> kdq@quest.UUCP (Kevin D. Quitt) writes:
-
- >mccall@mksol.dseg.ti.com (fred j mccall 575-3539) writes:
-
- >> In <gm5XTB3w165w@quest.UUCP> kdq@quest.UUCP (Kevin D. Quitt) writes:
- >> > On the other hand, since C does not truly support the boolean type,
- >> >I consider it misleading to assign a numeric value to a boolean. I
- >> >define TRUE as (1==1) because the result of this is a boolean - the
- >> >fact that it is represented by a numerical value is misleading.
- >>
- >> No, the result of this is *1*. If it is anything else, your compiler
- >> is seriously broken.
-
- > No, the result is *represented* by a 1. "1" is not a boolean value.
- >TRUE is a boolean value that requires a numeric definition because of
- >the limitations of the language. Other languages have booleans and do
- >not allow assigning numeric values to booleans. (On the other hand,
- >most of *those* languages are otherwise so broken as not warrant their
- >use.)
-
- Note that the name of the group is comp.lang.c. C does not have
- 'boolean' type. The result *IS* a 1. The result is NOT *TRUE*,
- because in C 'true' is any non-zero number.
-
- --
- "Insisting on perfect safety is for people who don't have the balls to live
- in the real world." -- Mary Shafer, NASA Ames Dryden
- ------------------------------------------------------------------------------
- Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.
-