User:Nate/rev/basic string/c str

Returns a pointer to a null-terminated character array with data equivalent to those stored in the string.

The pointer is such that the range is valid and the values in it correspond to the values stored in the string with an additional null character after the last position.

The pointer obtained from may be invalidated by:
 * Passing a non-const reference to the string to any standard library function, or
 * Calling non-const member functions on the string, excluding cpp/string/basic_string/operator_at, cpp/string/basic_string/at, cpp/string/basic_string/front, cpp/string/basic_string/back, cpp/string/basic_string/begin, cpp/string/basic_string/rbegin, cpp/string/basic_string/end, and cpp/string/basic_string/rend.

Writing to the character array accessed through is undefined behavior.

Since C++11, and  perform the same function.

Parameters
(none)

Return value
Pointer to the underlying character storage.

Complexity
Constant.