What does the ^ operator do to a BOOL?

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

What does this statement mean?

isChecked = isChecked ^ 1;

isChecked is a BOOL.

相关标签:
7条回答
  • 2021-01-23 04:51

    ^ is the exclusive or operator.

    In your example it is used to create a toggle - isChecked will be set only if isChecked was previously unset.

    0 讨论(0)
提交回复
热议问题