Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdaisy.UUCP Path: utzoo!watmath!watdaisy!ndiamond From: ndiamond@watdaisy.UUCP (Norman Diamond) Newsgroups: net.lang.c Subject: Re: <=> and obfuscation Message-ID: <6935@watdaisy.UUCP> Date: Thu, 7-Feb-85 22:14:27 EST Article-I.D.: watdaisy.6935 Posted: Thu Feb 7 22:14:27 1985 Date-Received: Fri, 8-Feb-85 01:12:28 EST References: <7699@brl-tgr.ARPA> <1293@bbncca.ARPA> <7853@brl-tgr.ARPA> <805@sjuvax.UUCP> Organization: U of Waterloo, Ontario Lines: 19 > To exchange two items without an intermediate variable, try: > > b ^= a ^= b ^= a > > Jon Shapiro Try it enough, and you'll see that some compilers bind the value of the first b before it is assigned at its second appearance, and other compilers bind it afterwards. Correct results are obtained in the latter case. Correct programming is obtained in neither case. -- Norman Diamond UUCP: {decvax|utzoo|ihnp4|allegra|clyde}!watmath!watdaisy!ndiamond CSNET: ndiamond%watdaisy@waterloo.csnet ARPA: ndiamond%watdaisy%waterloo.csnet@csnet-relay.arpa "Opinions are those of the keyboard, and do not reflect on me or higher-ups."