Re: RFC: String cleanup



Le vendredi 16 décembre 2005 à 16:16 +0100, Xavier Bestel a écrit :
> On Fri, 2005-12-16 at 16:11, Benoît Dejean wrote:
> 
> > > Changing from:
> > >   [const] char *str
> > > to:
> > >   [const] char str[]
> > 
> > Isn't that exactly the same ?
> 
> const char str[] is a string of chars (and a symbol pointing of them).
> 
> const char *str is a string of char and a pointer on them (and a
> symbol).

I don't get it. To me, it's is exactly the same, the [] notation giving
extra information that str is going to be used like an array.

> that's one more printer in memory, and a dereferenciation.

compile something with */[] : i get exactly the same asm output

-- 
GNOME http://www.gnomefr.org/
LibGTop http://directory.fsf.org/libgtop.html

Attachment: signature.asc
Description: This is a digitally signed message part



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