Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Ada
procedure swap(a, b: in out Integer)
is
    temp : Integer;
begin
    temp := a;
    a := b;
    b := temp;
end swap;
a^=b;
b^=a;
a^=b;

Only works for integer values (or casted pointers)

New implementation...
programming-idioms.org