Top "Variable-length-array" questions

A variable length array is an array in C99 and other languages whose size is unknown at compile time; instead, it's determined at runtime.

C compile error: "Variable-sized object may not be initialized"

Why do I receive the error "Variable-sized object may not be initialized" with the following code? int boardAux[length][length] = {{0}};

c compiler-errors initializer-list variable-length-array
Why aren't variable-length arrays part of the C++ standard?

I haven't used C very much in the last few years. When I read this question today I came across …

c++ arrays standards variable-length-array variable-length
How can I initialize an array without knowing it size?

I have a situation, where I have to apply a criteria on an input array and reuturn another array as …

java arrays arraylist size variable-length-array
Initializing variable length array

On initializing a Variable length array compiler gives an error message: [Error] variable-sized object may not be initialized Code snippet: …

c variable-length-array array-initialization
Difference between array type and array allocated with malloc

Today I was helping a friend of mine with some C code, and I've found some strange behavior that I …

c arrays malloc variable-length-array
Can we have a struct element of type Variable length array?

Can we declare a structure element of variable length? The condition is as follows: typedef struct { uint8_t No_Of_…

c struct variable-length-array
ISO C90 forbids variable length array

I'm dynamically calculating the size of an array. Something like: void foo(size_t limit) { char buffer[limit * 14 + 1]; } But just …

c variable-length-array
variable-length std::array like

As my usually used C++ compilers allow variable-length arrays (eg. arrays depending on runtime size), I wonder if there is …

c++ std variable-length-array
Does C++ support Variable Length Arrays?

No, wait, bear with me... VLAs were always a GCC extension, but they were adopted by C99: [C99: 6.7.5.2/4]: If the …

c++ c++11 variable-length-array
malloced array VS. variable-length-array

There are two ways to allocate memory to an array, of which the size is unknown at the beginning. The …

c malloc variable-length-array