Home > Backend Development > C++ > Are Variable Length Arrays (VLAs) Supported in C ?

Are Variable Length Arrays (VLAs) Supported in C ?

Barbara Streisand
Release: 2024-11-15 13:39:02
Original
1043 people have browsed it

Are Variable Length Arrays (VLAs) Supported in C  ?

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template