Given two Boolean, how to come up with the most elegant one liner that computes the XOR operation in C#?
I know one can do this by a combination of switch or if else but that would make my code rather ugly.
switch
if
else
bool xorValue = bool1 ^ bool2;
How come C# doesn't have a conditional XOR operator? Example: true xor false = true true xor true = false false xor false = false
I recently started playing around with C#, and I'm trying to understand why the following code doesn't compile. On the line with the error comment, I get: Cannot implicitly convert type 'int' to 'char'. An explicit conversion exits (are you …
I read that the ^ operator is the logical XOR operator in C#, but I also thought it was the "power of" operator. What is the explanation?