June 2025
Intermediate to advanced
1093 pages
33h 24m
English
|
Container |
Description |
|---|---|
|
basic_string |
Specialized container for texts, similar to vector |
|
string |
Template specialization: basic_string<char> |
Table 24.11 Profile: “string”.
Almost everything you can do with a vector, you can also do with a basic_string. The relationship goes so far that basic_string even has a push_back method for appending individual characters. And string, in turn, is just a template specialization of basic_string<char>.
Although vector<char> is very similar to string, you should use each when it semantically fits better. string is better suited for texts and text manipulations, while vector<char> is better when the characters are to ...
Read now
Unlock full access