Possible Duplicates:
Is it safe to use -1 to set all bits to true?
int max = ~0; What does it mean?
Hello,
I have stumbled upon this piece of code..
size_t temp;
temp = (~0);
Anyone knows what it does?
~
is the bitwise not operator, it inverts each bit of the operand. In this case the operand is 0, so every bit is initially 0, and after applying the bitwise not every bit will be 1. The end result is you get a size_t filled with 1 bits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With