std::basic_string::c_str

From Cppreference

Jump to: navigation, search
const CharT* c_str() const;

Returns pointer to a null-terminated character array with data equivalent to those stored in the string. Specifically the pointer is such that range [data(); data() + size()) is a valid.

Contents

[edit] Parameters

(none)

[edit] Return value

pointer to the a null-terminated character string with the data of the string.

[edit] Complexity

Constant.

[edit] See also

front (C++11)
accesses the first character
(public member function)
back (C++11)
accesses the last character
(public member function)
data
returns a pointer to the first character of a string
(public member function)