Date: Thu, 20 Feb 1997 08:58:20 +0200 (IST) From: Eli Zaretskii To: George Foot cc: djgpp AT delorie DOT com Subject: Re: Variable length array ? In-Reply-To: <5efi13$s1o@news.ox.ac.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 19 Feb 1997, George Foot wrote: > Note that variable length arrays are a gcc extension. For portability you > should use: > > int *arr=(int *)malloc(i*sizeof(int)); A better way would be to use `alloca'. It is slightly less portable than `malloc', but much faster and more convenient if you don't need large buffers (no need to free the buffer, less heap fragmentation, etc).