Is it a good idea to use C99 VLA compared to malloc/free?

后端 未结 6 757
旧时难觅i
旧时难觅i 2020-11-28 11:26

Is it a good idea to use C99 VLA? When is it appropriate to use VLA compared to malloc/free? (since VLA may blow up stack?)

6条回答
  •  被撕碎了的回忆
    2020-11-28 11:42

    C++ does not support VLAs. So it will be little more effort to port the code to C++, should the need arise.

    Then again, some believe this is actually a good thing and cunningly propose "class" as a wonderful name for a symbol in c :-)

提交回复
热议问题