Re: Abi string class


Subject: Re: Abi string class
From: Mike Nordell (tamlin@algonet.se)
Date: Fri Feb 02 2001 - 13:21:59 CST


Leonard Rosenthol wrote:
> If I recall correctly, length() and size() are two VERY
> different methods of the standard C++ class.

Nope.

> length() is the functional equivalent of strlen(s), while
> size is actually the allocated buffer size (which is NOT
> necessarily the size of the string + 1).

Not so. length() and size() actually both returning the length of the
controlled sequence (i.e. strlen). The "internal-buffer-size" function you
were thinking of is capacity().

I might add that I've never seen the use of length() which explains why I
was completely unaware of it's existance.

/Mike



This archive was generated by hypermail 2b25 : Fri Feb 02 2001 - 13:30:57 CST