Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!usenet.ins.cwru.edu!abvax!iccgcc!browns From: browns@iccgcc.decnet.ab.com (Stan Brown, Oak Road Systems) Newsgroups: comp.lang.c Subject: RE: TRUE and FALSE (or true and false) Message-ID: <708.26dd1bf9@iccgcc.decnet.ab.com> Date: 30 Aug 90 19:00:25 GMT References: <11215@alice.UUCP> <514@demott.COM> <2316@cirrusl.UUCP> <3835@sactoh0.SAC.CA.US> <26280@mimsy.umd.edu> Lines: 27 In article <26280@mimsy.umd.edu>, chris@mimsy.umd.edu (Chris Torek) writes: > Since this is all going around again (already!), it is probably time > for a small addition to the FAQ list: > > Q: How about Booleans in C? For instance: > > typedef int bool; > #define FALSE 0 > #define TRUE 1 > > A: Some people believe this adds clarity. Beware, however: > > typedef enum { true, false } bool; /* bug */ > [rest of excellent comments deleted] Chris, I think adding this to the FAQ's is an excellent idea. I like the way you said in your post that it's not settled whether int or enum is better for this. Only suggestion I'd make: you tell how _not_ to write the enum; why not also tell how to write it: typedef enum {false, true} bool; Stan Brown, Oak Road Systems, Cleveland, Ohio, U.S.A. (216) 371-0043 The opinions expressed are mine. Mine alone! Nobody else is responsible for them or even endorses them--except my cat Dexter, and he signed the power of attorney only under my threat to cut off his Cat Chow!