Variable-length array

Programming languages that support VLAs include Ada, ALGOL 68 (for non-flexible rows), APL, C# (as unsafe-mode stack-allocated arrays), COBOL, Fortran 90, J, and Object Pascal (the language used in Delphi and Lazarus, that uses FPC).

Because the array is declared as an automatic variable, its lifetime ends when read_and_process() returns.

Linus Torvalds has expressed his displeasure in the past over VLA usage for arrays with predetermined small sizes because it generates lower quality assembly code.

[10] However, this should be understood in the wider context of environment and platform limits, such as the typical stack-guard page size of 4 KiB, which is many orders of magnitude smaller than SIZE_MAX.

Ada arrays carry their bounds with them, so there is no need to pass the length to the Process function.

The equivalent Fortran 90 function is when utilizing the Fortran 90 feature of checking procedure interfaces at compile time; on the other hand, if the functions use pre-Fortran 90 call interface, the (external) functions must first be declared, and the array length must be explicitly passed as an argument (as in C): The following COBOL fragment declares a variable-length array of records DEPT-PERSON having a length (number of members) specified by the value of PEOPLE-CNT: The COBOL VLA, unlike that of other languages mentioned here, is safe because COBOL requires specifying maximum array size.