Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!jbs From: jbs@eddie.MIT.EDU (Jeff Siegal) Newsgroups: comp.lang.c Subject: Re: Autoincrement question Message-ID: <7593@eddie.MIT.EDU> Date: Sun, 6-Dec-87 13:00:22 EST Article-I.D.: eddie.7593 Posted: Sun Dec 6 13:00:22 1987 Date-Received: Fri, 11-Dec-87 06:19:15 EST References: <1507@ogcvax.UUCP> <3333@sigi.Colorado.EDU> Reply-To: jbs@eddie.MIT.EDU (Jeff Siegal) Organization: MIT, EE/CS Computer Facilities, Cambridge, MA Lines: 18 In article <3333@sigi.Colorado.EDU> swarbric@tramp.Colorado.EDU (SWARBRICK FRANCIS JOHN) writes: >[...]There is supposedly >a section in K&R (I don't have it) that says a[i] = i++ is ambiguous. >[...] Page 50 (end of Chapter 2) "One unhappy situation is typified by the statement a[i] = i++; The question is whether the subscript is the old value of i or the new...." Summary: Don't use the target of an auto-increment or auto-decrement operator elsewhere in the same expression. Jeff Siegal