This prints out a 0 and I'm not sure why. Any insight? Thanks!Code:#include <stdio.h> main () { printf(" %x", !0xabababababab ); }
This prints out a 0 and I'm not sure why. Any insight? Thanks!Code:#include <stdio.h> main () { printf(" %x", !0xabababababab ); }
0x is a prefix for hexadecimal numbers.
a,b are valid hex digits, so it is a number which is not 0.
To expand on manasij7479's comment:
Code:non-zero value == true zero value == false !(non-zero value) == !(true) == false == 0 !(zero value) == !(false) == true == 1
And to add to that, if you were trying to do bitwise NOT, that's ~.