ISO C90 forbids variable length array

前端 未结 6 1986
感动是毒
感动是毒 2020-12-09 23:14

I\'m dynamically calculating the size of an array. Something like:

void foo(size_t limit)
{
  char buffer[limit * 14 + 1];
}

But just GCC c

6条回答
  •  半阙折子戏
    2020-12-09 23:59

    As written in your question, this is from C99, not C90, you need to compile it against C99 to be able to use variable length arrays.

提交回复
热议问题