Mask and shift (as suggested in the previous answer); A slightly more complex alternative is the "pointer type arrow", i.e.
xlowbyte = (unsigned char*)(&Val) [0];
xmidlowb = (unsigned char*)(&Val) [1];
etc. - provided that you are on a machine with small names (which will most likely be used for Windows).
source
share