Bitwise '&' operator

前端 未结 6 990
慢半拍i
慢半拍i 2020-11-28 14:43

I am lacking some basic understanding in bitwise \'&\' operator.

5 = 101
4 = 100

So why the output of the below if conditi

6条回答
  •  囚心锁ツ
    2020-11-28 15:09

    It enters the if condition. Because after the & operation it returns non-zero value. In C, for all non-zero value it's like returning true.

提交回复
热议问题