C 语言有一种语法,叫做可变长数组(VLA, variable-length array),数组的长度不在编译时确定,而在运行时确定。最近看到了一篇文章《The (too) many pitfalls of VLA in C》,介绍了C语言中的可变长数组的诸多陷阱。.本文解释它有什么问题,为什么应该避免使用。
It generates much more code, and much slower code (and more fragile code), than just using a fixed key size would have done ~ Linus Torvalds