0
Bitwise Operators
I know there are operators like & and | those work with binary numbers (convert from decimal to binary) But... Are there more operators? And... Is it easy to know the result without make the number binary? Pd: I saw the operator ^ in a challenge and I'm not sure what it's (I lost :p)
5 odpowiedzi
+ 10
^ is xor operator. It gives 1 if the operands are different, and gives 0 if they are same.
0^0 = 0
0^1 = 1
1^0 = 1
1^1 = 0
+ 6
more about bitwise operators in C/C++ (and in many other languages too)
https://en.m.wikipedia.org/wiki/Bitwise_operations_in_C
+ 2
yes
+ 2
Okay, thanks a lot!
+ 1
If the numbers are 6^10, it works like that:
0110 (6)
1010 (10)
_________
1100 (14) ?