Hacker News new | past | comments | ask | show | jobs | submit login

It looks like standard C99 variable-length array (VLA) syntax: https://en.cppreference.com/w/c/language/array#Variable-leng...

The major difference is when the array is multi-dimensional. If you don't have VLAs then you can only set the inner dimensions at compile time, or alternatively use pointer-based work-arounds.

Even in the case of one-dimensional arrays, a compiler or a static analyzer can take advantage of the VLA size information to insert run-time checks in debug mode, or to perform compile-time checks.




Thank you - that makes total sense.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: