• Notice regarding image hosts and attachments. See here.

C Bit Manipulation Problem

  • Thread starter Thread starter Garee
  • Start date Start date

Garee

Garee

When I perform the calculation 25441 & 0000000011111111 the answer I recieve is puzzling. Instead of the expected 97 I instead get 577.

Code:
printf( "%d", 25441 & MASK );

The output is 577 where MASK is 0000000011111111.

I performed the bitwise addition manually to double check and the answer should definitely be 97. I must have an error somewhere.

Any help is much appreciated.
 
Back
Top Bottom