8 Apr
2006
8 Apr
'06
4:50 p.m.
On 4/8/06, Lynn Allan
From: "Olaf van der Spek"
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.