C语言中按位异或运算符^:

0 ^ 1 = 1

1 ^ 1 = 0

与1异或就是取反;

0 ^ 0 = 0

1 ^ 0 = 1

与0异或原位不变;