I have been reading this page here from MSDN regarding the XOR operator and its usage.
Half way down the page I read the following code:
// Bitwise exclusive-OR of 10 (2) and 11 (3) returns 01 (1).
Console.WriteLine("Bitwise result: {0}", Convert.ToString(0x2 ^ 0x3, 2));
Now, I cannot figure out for the life of me how 10 equates to 2, or how 11 equates to 3. Would anyone mind explaining this in simple terms so that I can clearly understand the concept here?
Thank you,
Evan
The “10” and “11” in the text are simply binary representations of numbers. So “10” in binary equals “2” in decimal, and “11” in binary equals “3” in decimal.
It’s not very clear though, I admit…
(If that doesn’t help, please comment saying what else is confusing. I suspect this is enough though.)