I cannot understand the purpose of size_t and how it works. I read many articles about it, but I could not find a clear explanation, yet. For now, what I know about this data type is:
- It is for objects in memory.
- Library functions that take or return sizes expect them to be of type or have the return type of size_t.
- It is the result of the sizeof operator.
- It is defined in stddef.h, and is unsigned int type which has at least 16 bits.
Please give me more information about what it does and why we need this. In addition, I saw some people mentioning that the size_t's capacity changes depends on its implementation(ex: 64bit / 32 bit system?). Please give me some information about its relationship to its implementation, too.
Thank you for your support.