C++ : Variable Length Array [duplicate]

不想你离开。 提交于 2019-11-28 14:36:07

First off, C++ has no VLAs. GCC implements them as a nonstandard extension.

Now, to answer your question in the context of said GCC extension:

I have observed that VLAs do not take continuous memory space, can anyone please confirm the same?

No, that is wrong. VLAs will take up continuous space. That space usually (always?) comes from the stack rather than the heap memory, just like statically sized C arrays.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!