Welcome to boolean logic 101. x = x^y; y = x^y; x = x^y; Nothing could be simpler . Joe P.S. Back in the olden days, we actually had to do this kind of stuff to save registers and avoid costly memory accesses. Honest!
Joined: Jun 23, 2003
Oh, and if you really want to be sick about it, try this: x ^= y ^= x ^= y; Joe
For those of us who aren't really familiar with those forums, Barry, what exactly is the purpose of the SCJP forum, for example? How would I "slip this into" the forum? Just a question that might stimulate a little more participation from those of us who currently don't spend time in the certification forums. Joe