Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!ogicse!intelhf!ichips!iwarp.intel.com!inews!nevin!bhoughto From: bhoughto@nevin.intel.com (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: Compound Assignments (was Re: Another error!) Message-ID: <3729@inews.intel.com> Date: 9 Apr 91 07:16:48 GMT References: <1991Apr4.205257.15205@mccc.edu> <1991Apr6.195901.25255@dvorak.amd.com> <1991Apr7.185259.12709@druid.uucp> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 27 In article <1991Apr7.185259.12709@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes: >In article <1991Apr6.195901.25255@dvorak.amd.com> Tim Olson writes: >>in 3.3.16.2 (Compound assignment): >> A compound assignment of the form E1 op= E2 differs from the >> simple assignment expression E1 = E1 op (E2) only in that the >> lvalue E1 is evaluated only once. > >Huh? Am I missing something or does that say that the two expressions >*ARE* evaluated differently? What it says is that the number of times >x is evaluated is the *only* difference but it is a difference. You must be missing something, because it clearly says they are evaluated differently and you shouldn't be confused about that. But the original expressions didn't involve any side effects other than the assignment itself, so no difference results. Obviously, a confluence of side-effects creates mass hysteria between the two: *(f(i++)) *= 2; /* cool */ *(f(i++)) = *(f(i++)) * 2; /* cholesterol */ --Blair "The cow operator tends to chew things of type cud more than once..."