Type size_t

size_t is a special unsigned integer type defined in the standard library of C and C++ languages. It is the type of the result returned by the sizeof and alignof operators.

The size_t is chosen so that it can store the maximum size of a theoretically possible array or an object. In other words, the number of bits in size_t is equal to the number of bits required to store the maximum address in the machine’s memory. On a 32-bit system size_t will take 32 bits, on a 64-bit one 64 bits. It means a variable of size_t type can safely store a pointer. The exceptions are platforms with memory segmentation and pointers to class functions.