8 Apr
2006
8 Apr
'06
5:38 p.m.
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?
No it doesn't have to have the NULL character at the end, and I believe at least some versions of libstdc++ don't put the NULL on the end unless you call c_str(). John.