Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!nbires!vianet!devine From: devine@vianet.UUCP (Bob Devine) Newsgroups: comp.lang.c Subject: Re: Defining TRUE and FALSE Message-ID: <208@vianet.UUCP> Date: Fri, 17-Jul-87 15:38:55 EDT Article-I.D.: vianet.208 Posted: Fri Jul 17 15:38:55 1987 Date-Received: Sat, 18-Jul-87 17:17:58 EDT References: <13851@watmath.UUCP> <632@itsgw.RPI.EDU> <13259@topaz.rutgers.edu> <6123@brl-smoke.ARPA> Organization: Western Digital, Boulder Tech Ctr Lines: 19 Keywords: boolean, true, false In article <13259@topaz.rutgers.edu> ron@topaz.rutgers.edu (Ron Natalie) writes: >On a different light, I've noticed nobody has mentioned the construct >of seting a variable of TRUE by incrementing it. In article <6123@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: > Yucky! The principle "say what you mean" implies that "flag = TRUE;" > is much better than "flag++". I've used this method many times -- but with a purpose in mind. Doing it with a test allows a easy check for multiple use of a option. For example, W_flag is set to 0 at the start and the following code is inside of a getopt() loop. if (W_flag++) { /* AI == Artificial Intimidation */ printf("Don't type the W flag twice again. Or else...\n"); exit(rand()); }