Are the shift operators (<<, >>) arithmetic or logical in C?

后端 未结 11 1707
粉色の甜心
粉色の甜心 2020-11-22 07:52

In C, are the shift operators (<<, >>) arithmetic or logical?

11条回答
  •  情书的邮戳
    2020-11-22 08:46

    According to many c compilers:

    1. << is an arithmetic left shift or bitwise left shift.
    2. >> is an arithmetic right shiftor bitwise right shift.

提交回复
热议问题