estimating x and y are integers
x = x ^ y; y = y ^ x; x = x ^ y;
shorter
x ^= y; y ^= x; x ^= y;
and a one liner if you like sunglasses
x ^= y; y ^= x; x ^= y;
Cool as ice ...
Code that helps you code.
x = x ^ y; y = y ^ x; x = x ^ y;
x ^= y; y ^= x; x ^= y;
x ^= y; y ^= x; x ^= y;
No comments:
Post a Comment