std::basic_string::max_size is used to compute the maximum number of elements the string is able to hold due to system or library implementation limitations.
size_type max_size() const; Parameters : None Return value : Maximum number of characters Exceptions : None
Maximum size of a string is 4294967294
Note : The maximum size can depend on the compiler and system.
This article is contributed by Rohit Thapliyal. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.