C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C++ String max_size()This function returns the maximum length the string can reach due to known system. SyntaxConsider a string str. Syntax would be: str.max_size(); ParametersIt does not contain any parameter. Return valueThis function returns the maximum length that string can reach. Example 1Let's see the simple example. #include<iostream> using namespace std; int main() { string str = "Hello world"; cout<<"String is :" <<str<<'\n'; cout<<"Maximum size of the string is :"<<str.max_size(); return 0; }
Next TopicC++ Strings
|