c programming style - READ THIS

Kim Christian Madsen kimcm at diku.UUCP
Sun Aug 4 08:39:17 AEST 1985


In article <734 at lsuc.UUCP> dave at lsuc.UUCP (David Sherman) writes:
>In article <2439 at sun.uucp> guy at 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 at diku.uucp



More information about the Comp.lang.c mailing list