If I convert a std::string
into a CString
using something like:
std::string ss("Foo");
CString cs( ss.c_str() );
Does the CString
copy the characters from ss
or does it simply copy the char*
pointer?
My understanding of the c_str()
function is that it returns a pointer to a character array owned by the std::string
. So having a CString
using this internally would seem like a really bad idea as any nonconstant method on either of them would then invalidate the pointer held in the other.