Boost logo

Boost Users :

From: Victor A. Wagner Jr. (vawjr_at_[hidden])
Date: 2006-04-08 13:37:27


At 10:42 2006-04-08, Lynn Allan wrote:
> > On 4/8/06, Lynn Allan <l_d_allan_at_[hidden]> wrote:
> >>
> >> Sorry if this is off-topic.
> >>
> >> Just wanted to check .... are std::string's defined to be null
> >> terminated?
> >>
> >> I came across a web page that indicated they are, but you can find lots
> >> of
> >> misinformation on the web.
> >> http://www.codeproject.com/string/cppstringguide2.asp
> >>
> >> std::string's seem to be null terminated with the Microsoft vc7.1 and vc8
> >> compiler, but I wanted to check if this is generally true according to
> >> the
> >> C++ standard.
> >>
> >> I'm relatively new to stl and using std::string .... mostly have used C
> >> strings and MFC CStrings (which changed from vc6 to vc7.1?)
> >
>
>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.

bad idea all around. there are no guarantees of an internal layout
for std::string. I'm curious, though, _why_ are you interested?

>[bunch of irrelevant stuff deleted]

Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law"


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