Variable-length arrays are not part of the standard. They can be present as compiler extensions which is the case with GCC. When compiling you are likely to receive a warning of:
warning: ISO C++ forbids variable length array 'a' [-Wvla]
When applied to arrays, the sizeof operator returns the size of the entire array which is the size of the underlying type times the number of elements. The reference states, emphasis mine:
The size of each VLA instance does not change during its lifetime, but
on another pass over the same code, it may be allocated with a
different size.
The official GCC documentation titled 6.19 Arrays of Variable Length states:
These arrays are declared like any other automatic arrays, but with a
length that is not a constant expression. The storage is allocated at
the point of declaration and deallocated when the block scope
containing the declaration exits.
That being said prefer std::vector or std::array to raw (C style) arrays.