C++ meaning |= and &=

后端 未结 7 1476

I have a part of code that contains the following functions:

void Keyboard(int key)
{
    switch (key) {
    case GLFW_KEY_A: m_controlState |= TDC_LEFT; bre         


        
7条回答
  •  臣服心动
    2020-12-20 08:15

    x |= y is equivalent to x = x|y

    In general, for any binary operator *, a *= b is equivalent to a = a*b

    If you want to know what & and | are, read about bitwise operators.

提交回复
热议问题