什么是' = |'操作员呢?

时间:2014-05-13 06:05:07

标签: c

我用Google搜索,但它不会返回与表达式相关的结果。我猜这与位有关。 =|究竟做了什么?

1 个答案:

答案 0 :(得分:3)

看看这个

http://www.tutorialspoint.com/cprogramming/c_operators.htm

所以

  |   inclusive bitwise OR
  =   assignment
  |=  bitwise inclusive OR and assignment 
  =|  syntax error

至于| =

  a |= b;

等于

  a = a | b;