posted 20 years ago
byte 8 bit
max value it can hold " 0 1 1 1 1 1 1 1 "
8th bit is sign bit & value is +127
128 default data type is int (32 bytes)
128 ==> "0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 1 0 0 0 0 0 0 0"
cast it(32 bits) to byte(8 bits) i.e pick 8 bits from right side i.e
1 0 0 0 0 0 0 0
Please convert this value to decimal value.
I am not in touch with this (shift operator & conversions), pls. wait for better response.
[ November 27, 2004: Message edited by: sanjeevmehra mehra ]
thanks & regards,<br />Sanjeev.