Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Maximum length of array in C language
Maximum length of array in C language

Theoretically, there is no limit to the maximum size of a C language array because it uses virtual storage.

For writing programs, for example, if you want to write subscripts, then due to the limitation of the maximum value of unsigned int, you can only use hexadecimal 0xffffffff, which is a little more than 4G in decimal.

It is difficult to say how much the specific program can obtain. Sometimes the compilation can pass, but an error occurs during runtime. You can also use malloc to dynamically allocate requests to see whether the allocation succeeds or fails.

For general programs, the array length is usually sufficient.