Array size at run time without dynamic allocation is allowed?

前端 未结 8 1776
一个人的身影
一个人的身影 2020-11-22 02:08

I\'ve been using C++ for a few years, and today I saw some code, but how can this be perfectly legal?

int main(int argc, char **argv)
{
    size_t size;
             


        
8条回答
  •  野性不改
    2020-11-22 02:37

    It is valid C99, it is not valid C++. This is one of not a few differences between the two languages.

提交回复
热议问题