Path: utzoo!mnetor!uunet!husc6!hao!boulder!tramp!swarbric From: swarbric@tramp.Colorado.EDU (SWARBRICK FRANCIS JOHN) Newsgroups: comp.lang.c Subject: Re: comma operator Message-ID: <3887@sigi.Colorado.EDU> Date: 19 Jan 88 00:04:33 GMT References: <3819@sigi.Colorado.EDU> <5080013@hpfcdc.HP.COM> <7120@brl-smoke.ARPA> Sender: news@sigi.Colorado.EDU Reply-To: swarbric@tramp.Colorado.EDU (SWARBRICK FRANCIS JOHN) Organization: University of Colorado, Boulder Lines: 15 In article <7120@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >By the way, I don't think there IS a good way to write a generic swap >macro. Didn't we go over this about a year ago? #define swap(a,b) ((a) = ((b) = ((a) = (a) ^ (b)) ^ (b)) ^ (a)) Try that, and tell me what you think. A super-genius friend of mine figured it out. He says it will work for anything (int, char *, etc.). But it sure boggles my mind... ------------------------------------------------------------------ Frank Swarbrick | "Ignorance and prejudice -- swarbric@tramp.UUCP | And fear walk and in hand." swarbric@tramp.Colorado.EDU | --RUSH ...!{hao|nbires}!boulder!tramp!swarbric