Encyclopedia > Xor swap algorithm Visual basic code

  Article Content

Xor swap algorithm/Visual basic code

The following Visual Basic subroutine swaps the values of its parameters using the xor operator.

 Sub Swap (Var1, Var2)
    Var1 = Var1 Xor Var2
    Var2 = Var2 Xor Var1
    Var1 = Var1 Xor Var2
 End Sub

See: Xor swap algorithm



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article

Warning: rtrim(): Invalid '..'-range, '..'-range needs to be incrementing in /var/www/kidsnetau/encyclopedia_promo4.php on line 55

Warning: rtrim(): Invalid '..'-range, '..'-range needs to be incrementing in /var/www/kidsnetau/encyclopedia_promo4.php on line 55
Sanskrit language

... and "stha" (standing, staying at) and means "they are in me". "-aham" (I) in the second line is nominative. na caaham = "...and not I....", meaning "but I am ...

 
 
 
This page was created in 23 ms