Possible Duplicate:
How to get the value of individual bytes of a variable?
How can I get single bytes from a word (for example an unsigned int in C) without using bit-wise operations (that is using arithmetic operations?)
I don't know why, but this formula (C-Like) for an x number doesn't seem to work:
floor(x / pow(R, i)) % R
where R
is the radix with which the number is represented, and i
is used to indicate the i
-th byte to obtain.