This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: static array size
- From: Andrew Haley <aph at redhat dot com>
- To: YH <yh at bizmail dot com dot au>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 24 Apr 2006 12:14:25 +0100
- Subject: Re: static array size
- References: <444CB1D3.8090704@bizmail.com.au>
YH writes:
>
> Is the following example legal in current GCC compilation for C
> program? I thought the static array allocation can only used by a
> defined constant such as char buf[MAX_SIZE], where #define MAX_SIZE 10?
>
> void DoSomthing(int size)
> {
> char buf[size];
>
> ...... do something ....
>
> }
This question should have been addresses to gcc-help@gcc.gnu.org.
Please RTFM, Section 5.13: Arrays of Variable Length
==============================..
......
.
Andrew.