string::length is an alias of string::size, returning both the exact same value.
Parameters
noneReturn Value
The number of characters that conform the string's content.size_t is an unsigned integral type.
Example
| 1 2 3 4 5 6 7 8 9 10 11 |
|
Output:
The size of str is 11 characters. |
Basic template member declaration
( basic_string<charT,traits,Allocator> )| 1 2 |
|
See also
| string::resize | Resize string (public member function) |
| string::max_size | Return maximum size of string (public member function) |
| string::capacity | Return size of allocated storage (public member function) |
