Are Variable Length Arrays in C ?
Contrary to popular belief, variable length arrays (VLAs) are allowed in C . However, you may be wondering why this is since VLAs are not part of the C standard.
Compiler Support for VLAs
The C standard does not require compilers to support VLAs, but compiler vendors are permitted to provide them as an extension. For instance, GCC versions 4.7 and later offer VLA support.
Proposed but not Implemented VLAs for C
Initially, VLAs were proposed for inclusion in C 14, but the proposal was not accepted. Subsequently, they were also excluded from C 17.
Therefore, while VLAs are not officially part of the C standard, you may still encounter them in certain environments like GCC.
The above is the detailed content of Are Variable Length Arrays (VLAs) Supported in C ?. For more information, please follow other related articles on the PHP Chinese website!