Is there any overhead for using variable-length arrays?
问题 Is there some overhead of using variable-length arrays? Could the size of array be passed via command line argument at run time? Why is it introduced, compared to automatic and dynamically allocating an array? 回答1: VLA does have some overhead (compared to "ordinary" named compile-time-sized array). Firstly, it has run-time length and yet the language provides you with means to obtain the actual size of the array at run-time (using sizeof ). This immediately means that the actual size of the