On Mon, 22 Jan 2001, Richard Anderson wrote:

> NO, that is not valid C, the array size must be fixed at compile time.

GCC allows the use of variable-length automatic arrays.

For example,

   FILE *
   concat_fopen (char *s1, char *s2, char *mode)
   {
     char str[strlen (s1) + strlen (s2) + 1];
     strcpy (str, s1);
     strcat (str, s2);
     return fopen (str, mode);
   }

is valid code if you use GCC. Whether it is a good idea to 
actually use this kind of C extensions is something you have 
to decide by yourself.

/Mike



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to