What does '<<' mean in C?

前端 未结 5 1877
一生所求
一生所求 2021-01-07 08:33

what does this mean?

#define WS_RECURSIVE    (1 << 0)

I understand that it will define WS_Recursive (1 << 0) but w

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-07 09:02

    It's a bit shift. (1 << 1) is 2 and (1 << 2) is 4. (1 << 0) is 1, which is rather silly, but at least it's precomputed at compile time.

提交回复
热议问题