I've seen both (size_t)-1
and ~0
used to represent large numbers, or numbers with all their bits flipped.
Is there any difference between the two? If so, what is it?
I found this question: What is the difference between -1 and ~0, however it did not answer my question because I'm dealing with unsigned integers (such as size_t
), as opposed to signed integers (such as int
).