Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!agate!shelby!msi-s0.msi.umn.edu!noc.MR.NET!uc!shamash!awm From: awm@shamash.cdc.com (Allan Magnuson) Newsgroups: comp.lang.c Subject: Swapping two variables in place Message-ID: <26101@shamash.cdc.com> Date: 22 Sep 90 04:46:50 GMT Reply-To: awm@shamash.UUCP (Allan Magnuson) Organization: Control Data Corporation, Arden Hills, MN Lines: 4 There was a message a while back about not being able to create a good #define function to swap two variables. How about this one: #define swap(a,b) a^=b^=a^=b