Boost logo

Boost Users :

From: Olaf van der Spek (olafvdspek_at_[hidden])
Date: 2006-04-08 11:56:44


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?)

std::string::c_str() returns a pointer to a null-terminated string, yes.


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