interface (ABI). Auto VLAs In addition, since the C version C99 (optional since C11), it is possible to create an array on the stack within a function, automatically, known as an auto VLA (variable-length array). void f(int alen) { int b[alen]; // auto VLA - this array's length is set at // the time of the function invocation / stack generation. for (int i = 0; i < alen; i++) b[i] = 1; // at the end of this function, b[] is within the stack frame, and will // disappear when the function exits, so no explicit call to free() is required. } See also Automatic variable Static variable Call stack Dynamic memory allocation Stack buffer overflow Stack machine Stack overflow References Memory management