Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site diku.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!mcvax!diku!kimcm From: kimcm@diku.UUCP (Kim Christian Madsen) Newsgroups: net.lang.c Subject: Re: c programming style - READ THIS Message-ID: <1095@diku.UUCP> Date: Sat, 3-Aug-85 18:39:17 EDT Article-I.D.: diku.1095 Posted: Sat Aug 3 18:39:17 1985 Date-Received: Sun, 4-Aug-85 07:14:34 EDT References: <11570@brl-tgr.ARPA> <935@teddy.UUCP> <1286@uwmacc.UUCP> <2439@sun.uucp> <734@lsuc.UUCP> Reply-To: kimcm@diku.UUCP (Kim Christian Madsen) Organization: DIKU, U of Copenhagen, DK Lines: 22 In article <734@lsuc.UUCP> dave@lsuc.UUCP (David Sherman) writes: >In article <2439@sun.uucp> guy@sun.uucp (Guy Harris) writes: >|| 2) "++a" and "a += 1" are completely equivalent expressions. > >Well, almost. On at least some systems, "a++" won't work if a is >float, while "a += 1" will add 1.0 to a. > >Dave Sherman >The Law Society of Upper Canada >Toronto >-- >{ ihnp4!utzoo pesnta utcs hcr decvax!utcsri } !lsuc!dave Well, you should know that `++' and `--' *ONLY* works on variables of type scalar, where a there is a defined successor or predecessor (You can compare these operators as the Pascal functions pred() and succ() ), and since a variable of type float has no defined successor/predecessor `++' and `--' won't work on it! Regards Kim Chr. Madsen a.k.a. kimcm@diku.uucp