Which ANSI C standard says something about bit wise XOR of two signed integers? I tried to read the standard, but it is vast.
XOR of two signed integers is valid as per C standard? What will happen to the sign bit of the result?
Which ANSI C standard says something about bit wise XOR of two signed integers? I tried to read the standard, but it is vast.
XOR of two signed integers is valid as per C standard? What will happen to the sign bit of the result?
Bitwise operations operate on bits, that is, on the actual 1's and 0's of the data. Therefore, sign is irrelevant; the result of the operation is what you'd get from writing out the series of 1's and 0's that represents each integer and then XORing each corresponding pair of bits. (Even type information is irrelevant, as long as the operands are integers of some sort, as opposed to doubles, pointers, etc.)