Jump to content

C++ string handling

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by BenFrantzDale (talk | contribs) at 16:57, 9 September 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

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.