Boost logo

Boost Users :

From: Olaf van der Spek (olafvdspek_at_[hidden])
Date: 2006-04-08 12:50:31


On 4/8/06, Lynn Allan <l_d_allan_at_[hidden]> wrote:
> From: "Olaf van der Spek" <olafvdspek_at_[hidden]>
> > std::string::c_str() returns a pointer to a null-terminated string, yes.
>
> Thanks, but that isn't quite my question. I'm interested in the actual
> internal layout of the data in the actual std::string.
>
> I realize that myString.c_str() returns a null terminated string, but my
> understanding is that the result of c_str() can be a separate buffer, not
> necessarily a pointer to the buffer used by the std::string. Does the
> internal data structure of the std::string itself have null termination, by
> definition of the C++ standard?

That's an implementation detail and I think that the standard doesn't
require it.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net