Home >Backend Development >C++ >Does C Support Variable Length Arrays (VLAs)?
Does C Support Variable Length Arrays (VLAs)?
Despite initial skepticism, Variable Length Arrays (VLAs) have been adopted by both GCC and C99. C99 specifies that arrays without a designated size are incomplete types, while arrays with a size of * represent variable length arrays of unspecified size, suitable only for declarations with function prototype scope. However, arrays with integer constant expressions and known element sizes are not variable length arrays.
Since C 11 is based on C99 (ISO/IEC 9899:1999), one might assume that it also supports VLAs. However, the introductory text on which this assumption is based does not imply that all C99 features are present in C 11. Therefore, while C 11 provides many enhancements over C, it does not include support for VLAs.
The above is the detailed content of Does C Support Variable Length Arrays (VLAs)?. For more information, please follow other related articles on the PHP Chinese website!