What does the ^ operator do to a BOOL?

后端 未结 7 1710
情深已故
情深已故 2021-01-23 04:10

What does this statement mean?

isChecked = isChecked ^ 1;

isChecked is a BOOL.

7条回答
  •  余生分开走
    2021-01-23 04:27

    "^" is called an exclusive OR or XOR operation. In this case, it will change boolean from true to false and vice-versa.

    To learn more on this, check this link

提交回复
热议问题