Jump to content

Xor swap algorithm/C code

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 198.4.83.52 (talk) at 17:51, 27 June 2003. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

// the following code block swaps the values in x and y // author: Kevin Damm

{

  x ^= y;
  y ^= x;
  x ^= y;

}