op= construction

C Waldman cgw at mruxe.UUCP
Tue Jun 10 01:22:21 AEST 1986




	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.



More information about the Comp.lang.c mailing list