views:

79

answers:

1

How to write this in C#.NET, I have not been encountered using the ^ or &

var reg_1 = 234 ^ (8393 & 1);
+4  A: 
var reg_1 = 234 ^ (8393 & 1);

Or, if you prefer:

var reg_1 = 235;

(If you're not using C#3 then replace var with int.)

The ^ is the XOR operator. The & is the AND operator.

LukeH
sv88erik
@sv88erik: In this context they're bitwise operators. See http://en.wikipedia.org/wiki/Bitwise_operation#XOR and http://en.wikipedia.org/wiki/Bitwise_operation#AND
LukeH
@Luke: Perfect! This is exactly what I'm working with!
sv88erik