class
<string>

std::string

typedef basic_string<char> string;
String class
Strings are objects that represent sequences of characters.

The standard string class provides support for such objects with an interface similar to that of standard containers, but adding features specifically designed to operate with strings of characters.

The string class is an instantiation of the basic_string class template that uses char as the character type, with its default char_traits and allocator types (see basic_string for more info on the template).

Member types

member typedefinition
value_typechar
traits_typechar_traits<char>
allocator_typeallocator<char>
referencechar&
const_referenceconst char&
pointerchar*
const_pointerconst char*
iteratora random access iterator to char (convertible to const_iterator)
const_iteratora random access iterator to const char
reverse_iteratorreverse_iterator<iterator>
const_reverse_iteratorreverse_iterator<const_iterator>
difference_typeptrdiff_t
size_typesize_t

Member functions


Iterators:

Capacity:

Element access:

Modifiers:

String operations:

Member constants


Non-member function overloads