c - difficulties with bit operations
Posted
by hatorade
on Stack Overflow
See other posts from Stack Overflow
or by hatorade
Published on 2010-05-04T07:14:59Z
Indexed on
2010/05/04
7:28 UTC
Read the original article
Hit count: 234
I'm debugging a program with GDB.
unsigned int example = ~0;
gives me:
(gdb) x/4bt example
0xffd99788: 10101000 10010111 11011001 11111111
why is this not all 1's? i defined it as ~0... then the next line of code is:
example>>=(31);
and GDB gives me this when I try to examine the memory at bits:
(gdb) x/4bt example
0xffffffff: Cannot access memory at address 0xffffffff
what is going on???
© Stack Overflow or respective owner