Welcome to MSDN Blogs Sign in | Join | Help

XOR in C#

Random factoid:

Use  ^  for bitwise XOR in C#, for example:

  a = a ^ c;   (or simply:   a ^= c;)

 

Published Thursday, October 27, 2005 11:27 AM by Addys

Comments

# re: XOR in C#

Sunday, December 11, 2005 4:02 PM by C.K. "B.C."
Thank you!!
I needed to code a method that used xor in C# and I didn't know how, I didn't have any resource besides google that could tell me, and when I googled, I did not have any luck, for maby ten minutes of searching >:( but then I found this. probelm solved. Thanks!!

solution completed, an exerpt of my code:

static bool toggle(bool input)
{
return input ^ true;
}

# Santomania XOR in C | Outdoor Ceiling Fans

Sunday, May 31, 2009 5:10 AM by Santomania XOR in C | Outdoor Ceiling Fans

# Santomania XOR in C | Wood TV Stand

Monday, June 01, 2009 2:11 PM by Santomania XOR in C | Wood TV Stand

# Santomania XOR in C | Cast Iron Cookware

Thursday, June 11, 2009 10:41 PM by Santomania XOR in C | Cast Iron Cookware
New Comments to this post are disabled
 
Page view tracker