cpp/string/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.

Writing to the character array accessed through is undefined behavior.

Parameters
(none)

Return value
Pointer to the underlying character storage.

Complexity
Constant.