I understand how working XOR with Boolean type dates, but how can I use integer type?
In C++ all data that !=0 are considered true, but with int type I get the following:
10 XOR 10 --------> FALSE
10 XOR 20 --------> TRUE ; Is any chance to get FALSE too?
I may be wrong, as I don't often use it, but if you are referring to ^ as XOR then it is a BITWISE operator, not a "normal" boolean operator like && (AND) or || (OR).
In binary,
10 is 00001010
20 is 00010100
and bit-by-bit ^ between these would give
00011110
which is non-zero, hence TRUE.
(OK, that's the rough gist - somebody else will have to check my binary and bitwise operations!)
The corresponding bitwise operators for AND and OR are (I think) & and | (that's single characters).