std::basic_string::data

From Cppreference

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

Returns pointer to the underlying array serving as character storage. Specifically the pointer is such that range [data(); data() + size()) is a valid.

Contents

[edit] Parameters

(none)

[edit] Return value

pointer to the underlying character storage.

[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)
c_str
returns a non-modifiable standard C character array version of the string
(public member function)