If I set a size_t
variable to -1, like in:
size_t s = -1;
Is it guaranteed it will contain the maximal value that can be hold by s
?
For example, if sizeof(size_t)
is 4 bytes, can I assume that s
would be 0xFFFFFFFF
?
As a complementary info: I need this for implementing a set, in which I intend to use -1 as 'item doesn't exist'. And at the same time I don't want to sacrifice the 0, nor using an int
.