I have an int (32) Val value packaged into a form
---------------------------------------- | 32-XXXXXXXXX-16 | 15-short-int-val-0 | ----------------------------------------
When extracting a short integer value from this Val , if I perform an operation
short temp = Val & 0x0000FFFF;
What will be the return type of the Val & 0x0000FFFF ? Do I need to enter a value for (short)(Val & 0x0000FFFFF) in order to have the correct data stored in temp ?
Doubt arises because I assume that hexadecimal numbers are essentially treated as unsigned integers.
How is this operation different from performing
short temp = Val & 0xFFFF;
c type-conversion
Bleamer
source share