What does | and << mean?

前端 未结 2 1093
轮回少年
轮回少年 2021-01-18 23:37

Sorry if this is a common question but I don\'t know what it\'s called so I\'m having trouble searching for it.

How does this work:

view.autoresizing         


        
相关标签:
2条回答
  • 2021-01-19 00:06

    "|" is a bitwise 'or'.

    "<<" is also a bitwise operation shifting. it moves all the bits to the left:

    00100 << 1 = 01000
    

    Read the wiki, you're interested in "or" and shift operations.

    0 讨论(0)
  • 2021-01-19 00:31

    These are C bit level operators.

    | is binary or: 0001 | 0010 = 0011.

    << is a bit shift: 0001 << 1 = 0010.

    They are used for bitmasks.

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