One way to do this is to use a combination of bit-shifts, and bit masking.
If you &
a 32-bit integer against the 32-bit integer 0x000000FFu
the result is an integer where only the bits that were A: already set and B: located in the last 8 bits of the number are set. To select other parts of the integer, you can bitshift by a multiple of 8. I.E. (x >> 8) &
0x000000FFuto select the second byte from the right,
(x >> 16) & 0x000000FFu
to select the third.
You could then print out each of these as regular unsigned integers in decimal format.
I'm not sure how the performance of this method would compare to casting an unsigned integer pointer to an unsigned char pointer and doing it that way.