lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, 24 Feb 2005 17:07:52 -0300, Alex Sandro Queiroz e Silva
<ventonegro@ventonegro.org> wrote:
> Brian Weed wrote:
> >
> > const char * getSome()
> > {
> >    return "some string";
> > }
> 
>     The address of the string would be meaningless after the return of
> this function, wouldn't it?

No... string literals aren't on the stack, so the pointer will remain
valid. (Not sure if this is specified by the standard, or just the way
everyone does it.)