Why is size_t unsigned?

size_t is unsigned for historical reasons. On an architecture with 16 bit pointers, such as the “small” model DOS programming, it would be impractical to limit strings to 32 KB. For this reason, the C standard requires (via required ranges) ptrdiff_t, the signed counterpart to size_t and the result type of pointer difference, to be … Read more