How to: The ~ operator?

后端 未结 4 648
我寻月下人不归
我寻月下人不归 2020-11-27 19:23

I can\'t google the ~ operator to find out more about it. Can someone please explain to me in simple words what it is for and how to use it?

4条回答
  •  臣服心动
    2020-11-27 20:24

    ~ is a bitwise NOT operator. It will invert the bits that make up the value of the stored variable.

    http://en.wikipedia.org/wiki/Bitwise_operations_in_C#Bitwise_NOT_.22.7E.22_.2F_one.27s_complement_.28unary.29

提交回复
热议问题