Re: return a string



Alan Balmer <albalmer@xxxxxxx> writes:
> On 29 Apr 2005 14:04:10 -0700, underscore0x5f@xxxxxxxxx (Nascimento)
> wrote:
[...]
>>{
>> int i;
>> char tralha[num];
>
> You can't declare a variable size array.

Yes you can, if you have a C99 compiler or a pre-C99 compiler that
supports the feature. (The form of the diagnostics implies that he's
probably using gcc, which does support VLAs.)

I covered the portability issues in my previous followup.

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.



Relevant Pages

  • Re: passing command line argument to array
    ... I would like to pass the size of an array from the commandline. ... int main{ ... Even under a C99 compiler, this will not do what you want. ...
    (comp.lang.c)
  • Re: return a string
    ... >> You can't declare a variable size array. ... if you have a C99 compiler or a pre-C99 compiler that ... Balmer Consulting ...
    (comp.lang.c)