Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpda!hpcupt1!swh From: swh@hpcupt1.HP.COM (Steve Harrold) Newsgroups: comp.lang.c Subject: Re: Brain Teaser Message-ID: <5940029@hpcupt1.HP.COM> Date: 28 Mar 90 16:43:20 GMT References: <10289@wpi.wpi.edu> Organization: Hewlett Packard, Cupertino Lines: 20 >>> Problem: >>> Swap two pointers without using a third pointer. Answer: The sequence: x ^= y ; y ^= x ; x ^= y ; will exchange the contents of two like-sized values, "x" and "y". To answer your specific question, you will probably have to coerce your pointer variables to int (or long) to make this sequence work. Of course, once you do that, you no longer have portable code!!. Do you have a practical need to bypass the use of a temporary variable? If this is just an intellectual exercise, then post some more. I think many of us would enjoy them.