C++ String max_size() function
Example
Get the maximum length (size) a string can reach:
string txt = "Hello";
cout << txt.max_size();
Try it Yourself »
Definition and Usage
The max_size()
function returns the maximum
length of a string (the max. available length()
).
Syntax
string.max_size();
Parameters
None.
Technical Details
Returns: | The maximum length a string can reach |
---|
Related Pages
Read more about strings in our String Tutorial.