Question:
What is the size_t type, which is similar to the int type? And what is it used for?
Answer:
Open cplusplus.com – size_t and read
size_t Unsigned integral type
unsigned integer. That is, it is not an int, it is signed.
Alias of one of the fundamental unsigned integer types.
An alias for one of the unsigned fundamental types. (that is, most likely 4 or 8 bytes).
It is a type able to represent the size of any object in bytes: size_t is the type returned by the sizeof operator and is widely used in the standard library to represent sizes and counts.
Designed to display the size of any object in bytes: this returns size_of and many standard library functions – all sorts of length and count.