Bit sequence !

hi everybody

I'm wondering how can i work out in "C" the bit sequence and the values used to store an integer. "using the easiest way"

for example

If the number was 12345 the output

Values: 57 48 0 0
Bit sequence: 00111001 00110000 00000000 00000000


cheers!
Last edited on
Huh?!
12345 in binary is 0011 0000 0011 1001.

The easiest way is a clever use of the shift operators and sizeof.
would you give an example please!

thanks a lot
closed account (z05DSL3A)
google "displaying bit patterns in c"
Topic archived. No new replies allowed.