Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site asgb.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!bmcg!asgb!gupta
From: gupta@asgb.UUCP (Yogesh K Gupta)
Newsgroups: net.lang.c
Subject: Re: <=> and obfuscation
Message-ID: <637@asgb.UUCP>
Date: Mon, 11-Feb-85 11:53:48 EST
Article-I.D.: asgb.637
Posted: Mon Feb 11 11:53:48 1985
Date-Received: Wed, 13-Feb-85 07:40:55 EST
References: <7699@brl-tgr.ARPA> <1293@bbncca.ARPA> <7853@brl-tgr.ARPA> <805@sjuvax.UUCP>
Organization: Burroughs Corp. ASG, Boulder Colo.
Lines: 20

> > 	To exchange two items without an intermediate variable, try:
> > 
> > 	b ^= a ^= b ^= a
>
>  This works for integer variables only.

In C, the ^ is a bitwise operator. Thus,
	b ^= a ^= b ^= a
will exchange the bit patterns in the two variables.
As long as the two variables are of the SAME type, the values will be
swapped.

As to the efficiency and programming style ...

-- 
Yogesh Gupta                           Advanced Systems Group,
{sdcrdcf, sdcsvax}!bmcg!asgb!gupta     Burroughs Corp., Boulder, CO.
--------------------------------------------------------------------
	All opinions contained in this message are my own and do not
	reflect those of my employer or the plant on my desk.