Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site petrus.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!petrus!hammond
From: hammond@petrus.UUCP
Newsgroups: net.lang.c
Subject: Re: <=> and obfuscation
Message-ID: <280@petrus.UUCP>
Date: Fri, 8-Feb-85 08:59:39 EST
Article-I.D.: petrus.280
Posted: Fri Feb  8 08:59:39 1985
Date-Received: Sat, 9-Feb-85 06:23:49 EST
References: <7699@brl-tgr.ARPA> <1293@bbncca.ARPA> <7853@brl-tgr.ARPA> <805@sjuvax.UUCP> <11927@gatech.UUCP>
Organization: Bell Communications Research, Inc
Lines: 12

> > 	To exchange two items without an intermediate variable, try:
> > 
> > 	b ^= a ^= b ^= a
> 
> However, if a == b when you start out, you end up with a == 0 && b == 0.
> 
NO!, I just tried it on our compiler, if a!=0 && b!=0 && a==b then
after the suggested line the variables still have the same value.
>
> This also only works on integer style variables.

Good point.