Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!caip!princeton!allegra!alice!ark From: ark@alice.UucP (Andrew Koenig) Newsgroups: net.lang.c Subject: Re: op= construction Message-ID: <5614@alice.uUCp> Date: Mon, 9-Jun-86 22:41:26 EDT Article-I.D.: alice.5614 Posted: Mon Jun 9 22:41:26 1986 Date-Received: Thu, 12-Jun-86 01:29:15 EDT References: <108@mruxe.UUCP> Organization: Bell Labs, Murray Hill Lines: 24 > Quick question- > In a loop, an array element is incremented, then the array index > is advanced to the next element. I recently coded this with > .... > total[i++] += f; > .... > After a couple of "Memory fault- core dumped" messages, I realized > that i is getting incremented twice. I broke it into two lines and > everything was ok, but I'm wondering why this construction doesn't > work. Easy -- your compiler is broken. total[i++] += f; should be equivalent to total[i] += f; i++; If it isn't, your compiler is busted. Simple as that.