How to convert a 16 bit word into a signed int using 2's complement, C++

后端 未结 0 1995
粉色の甜心
粉色の甜心 2020-12-19 02:33

I am reading data from a sensor over an i2c line, and I receive a 16 bit word that represents a signed integer using 2\'s complement. I know there is a sane way to do this,

相关标签:
回答
  • 消灭零回复
提交回复
热议问题