Variable Length Array in C Programming

In this article, you will learn how to create Variable Length Array in C Programming (VLAs) such as one-dimensional and multi-dimensional arrays.

Until now, we have used an array that had constant size. The size of the array is fixed.

Wait for a second, what if you don’t know array size at compilation time?

Here comes the importance of variable length array in C programming whose length or size is evaluated at execution time. We can easily declare one dimensional, two dimensional and multi-dimensional arrays.

Note: sizeof operator when used in variable length array operates at run time instead of at compile time.