Someone in your office wants to know if it can be done?
That's got to be the most hilarious thing I've heard in a long time. And do they have two tufts of pointy hair as well?
Seriously, though .. you need to understand number bases to understand what's going on here. Just telling you that the answer is 63,360 (which it isn't) isn't going to help you.
You need to decompose the number into tens, hundreds and thousands, then remember that in hexadecimal, ten is actually 16, a hundred is actually 256 and a thousand is actually 4,096. So then it's 9 x 4,096 plus .. you get the idea.
Alternatively, you could convert 0x9210 to binary, giving 1001 0010 0001 0000, then just multiplying by the appropriate powers of two. Actually, that looks pretty easy .. 16,384 + 4096 .. well, you get the idea.
Alternatively, in C you could sscanf the number in using "%x", then print it out using "%d" and get the machine do to the conversion.
The Windows calculator application also converts between hex and decimal.
So, anyway, good luck.
--t. alex
"Excellent. Release the hounds." -- Monty Burns.
|