C++ string handling
Appearance
In the C++ programming language, the std::string
class is a standard representation for a string of text. This class removes many of the problems introduced by C-style strings by putting the onus of memory ownership on the string
class rather than on the programmer. This class also provides implicit construction from C-style strings, explicit conversion to C-style strings, and a comparison operator so that strings can be compared using ==
just like integers rather than the obtuse 0 == strcmp(a, b)
required of C-style strings.