string
TypeA 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.