3 ms·
VLA are exactly an array type that knows its length, i.e. a dependent type. VLAs on the stack had some issues, but pointers to VLAs, i.e. variably modified type
by uecker 4y ago
VLA are exactly an array type that knows its length, i.e. a dependent type. VLAs on the stack had some issues, but pointers to VLAs, i.e. variably modified types are quite powerful. Language and compiler support is still evolving though.
But you can get run-time bounds checking already:
https://godbolt.org/z/jhcavobYj https://godbolt.org/z/jhcavobYj
Support for statically detecting problems is also (slowely) improving.