Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!vax135!cornell!uw-beaver!tektronix!decvax!genrad!panda!talcott!harvard!seismo!brl-tgr!tgr!cottrell@nbs-vms.ARPA From: cottrell@nbs-vms.ARPA Newsgroups: net.lang.c Subject: swapping variables Message-ID: <8001@brl-tgr.ARPA> Date: Mon, 4-Feb-85 17:12:36 EST Article-I.D.: brl-tgr.8001 Posted: Mon Feb 4 17:12:36 1985 Date-Received: Sat, 9-Feb-85 04:44:47 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 17 /* > > int ptr[] <=> int *ptr > > Oo, oo! This brings to mind a useful language extension: > > a <=> b; > > for exchanging the contents of a and b. How often have you written: > > { register type t; > > t = a; > a = b; > b = t; > } Rarely. I use: `a ^= b; b ^= a; a ^= b;' Only worx for integer types. */