Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ariel.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxb!mhuxn!mhuxm!mhuxj!houxm!vax135!ariel!jlw From: jlw@ariel.UUCP (J.WOOD) Newsgroups: net.lang.c Subject: Re: using ^= to swap two integers Message-ID: <842@ariel.UUCP> Date: Mon, 11-Feb-85 21:32:32 EST Article-I.D.: ariel.842 Posted: Mon Feb 11 21:32:32 1985 Date-Received: Wed, 13-Feb-85 01:45:43 EST References: <11950@gatech.UUCP> Distribution: net Organization: AT&T-ISL, Holmdel, NJ Lines: 17 Regarding swapping via the xor operation as in: b ^= a ^= b ^= a; be careful that a and b are not at the same address as when using pointers. In that case the value(s) are (both) set to zero. I got burned on this once. Joseph L. Wood, III AT&T Information Systems Laboratories, Holmdel (201) 834-3759 ariel!jlw