[Solved] What does var[x] do?


This is a declaration of a Variable Length Array (VLA).

The value of expression x (most likely, a variable) is treated as the number of array elements. It must have a positive value at the time the expression is evaluated, otherwise the declaration of the VLA produces undefined behavior.

8

solved What does var[x] do?