In C and C++, size_t is the unsigned integer type of the result of the sizeof operator
size_t
can store the maximum size of a theoretically possible object of any type (including array).
When indexing C++ containers, such as std::string
, std::vector
... the appropriate type is the member typedef size_type
provided by such containers (it's usually defined as a synonym for size_t
).
Further details: