can size of array be determined at run time in c?

前端 未结 6 2001
日久生厌
日久生厌 2020-11-29 08:24

As I know, an array needs to have a specific size before compiling time in c.

I wonder why this code still works?

int s;
printf(\"enter the array si         


        
6条回答
  •  悲&欢浪女
    2020-11-29 08:53

    Array sizes need to be known with ANSI 89 C. The 99 version of the spec removed this limitation and allowed for variable sized arrays.

    Here is the documentation no the GNU version of this feature

    • http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC49

提交回复
热议问题