Retains pointer returned by std::string's c_str() method, which isn't defined to be persistent in any way beyond the lifetime of the expression. If you need a c string to stick around you get to copy it and manage the lifetime yourself - that's the fun of c strings.
Retains pointer returned by std::string's
c_str()
method, which isn't defined to be persistent in any way beyond the lifetime of the expression. If you need a c string to stick around you get to copy it and manage the lifetime yourself - that's the fun of c strings.