Monday, June 21, 2010

about C data type and bitwise operator

Q?1: How to case a char or int constant to short in C?
Q?2: How to case '\213' to unsigned char?
Q?3: Why float(4 bytes) allow 23 bits for mantissa since exponent occupied 8 bits,(sign takes one bit? but exponent takes 7 or 8 )
Q?4: %02x 0x stands for hexadecimal, but what is '2' for?
Q?5: why ~(-1) is 0, ~27 is -28, what is binary for '-' sign.

No comments:

Post a Comment