Can someone clarify what happens when an integer is cast to a short in C? I\'m using Raspberry Pi, so I\'m aware that an int is 32 bits, and theref
short
int
Simply the high 16 bits are cut off from the integer. Therefore your short will become 0x8642 which is actually negative number -31166.
0x8642
-31166