Bit sequence !

Jan 13, 2009 at 5:51am
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 Jan 13, 2009 at 5:54am
Jan 13, 2009 at 7:09am
Huh?!
12345 in binary is 0011 0000 0011 1001.

The easiest way is a clever use of the shift operators and sizeof.
Jan 16, 2009 at 4:37pm
would you give an example please!

thanks a lot
Jan 16, 2009 at 4:49pm
closed account (z05DSL3A)
google "displaying bit patterns in c"
Topic archived. No new replies allowed.