21.1 Introduction1

The class template basic_string provides typical string-manipulation operations such as copying, searching, etc. The template definition and all support facilities are defined in namespace std; these include the typedef statement


typedef basic_string<char> string;

that creates the alias type string for basic_string<char>. A typedef is also provided for the wchar_t type (wstring). Type wchar_t2 stores characters (e.g., two-byte characters, four-byte characters, etc.) for supporting other character sets. We use string exclusively ...

Get C++ How to Program, 10/e now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.