The C standard guarantees that an int
is able to store every possible array size. At least, that\'s what I understand from reading §6.5.2.1, subsection 1 (Array
integer type is not necessarily an "int". "long long" is an integer type too, as is "size_t".
Arrays can be larger than 2GB. This property is quite handy for those who write memory hungry programs, e.g DBMS with big buffer pools, application servers with big memory caches etc. Arrays bigger than 2GB/4GB is the whole point of 64 bit computing :)
size_t for strlen(), at least sounds compatible with how C standard handles arrays, whether it makes practical sense or not, or whether somebody have seen strings that large, is another question.