B.7 Arrays and Pointers

Largest Array Size

The type of integer required to hold the maximum size of an array—that is, the size of size_t (§3.3.3.4, 4.1.1)

The size_t typedef is an unsigned short, with the range 0x0000 to 0xFFFF. Huge arrays can exceed this limit if they contain more than 65,535 elements. Arithmetic operations on huge arrays should therefore cast size_t and the result of an arithmetic operation on pointers to unsigned long.