Why is it that in C++ containers, it returns a size_type
rather than an int
? If we\'re creating our own structures, should we also be encouraged to
Some of the answers are more complicated than necessary. A size_t is an unsigned integer type that is guaranteed to be big enough to store the size in bytes of any object in memory. In practice, it is always the same size as the pointer type. On 32 bit systems it is 32 bits. On 64 bit systems it is 64 bits.