Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site gatech.UUCP Path: utzoo!utcs!lsuc!pesnta!amd!gatech!arnold From: arnold@gatech.UUCP (Arnold Robbins) Newsgroups: net.lang.c Subject: Re: <=> and obfuscation Message-ID: <11927@gatech.UUCP> Date: Thu, 7-Feb-85 13:49:22 EST Article-I.D.: gatech.11927 Posted: Thu Feb 7 13:49:22 1985 Date-Received: Fri, 8-Feb-85 06:42:03 EST References: <7699@brl-tgr.ARPA> <1293@bbncca.ARPA> <7853@brl-tgr.ARPA> <805@sjuvax.UUCP> Organization: Firefighters Extraordinaire, Inc. Lines: 17 > [Aren't you hungry...] > > To exchange two items without an intermediate variable, try: > > b ^= a ^= b ^= a > > Jon Shapiro However, if a == b when you start out, you end up with a == 0 && b == 0. This also only works on integer style variables. -- Arnold Robbins CSNET: arnold@gatech ARPA: arnold%gatech.csnet@csnet-relay.arpa UUCP: { akgua, allegra, hplabs, ihnp4, seismo, ut-sally }!gatech!arnold Help advance the state of Computer Science: Nuke a PR1ME today!