3.2. Library string Type

Image

A string is a variable-length sequence of characters. To use the string type, we must include the string header. Because it is part of the library, string is defined in the std namespace. Our examples assume the following code:

#include <string>
using std::string;

This section describes the most common string operations; § 9.5 (p. 360) will cover additional operations.


Image Note

In addition to specifying the operations that the library types provide, the standard also imposes efficiency requirements on implementors. As a result, library types are efficient enough for general use.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset