max_size [C++ Reference]
Keywords: string,max_size
Date: 2008-10-14T15:42:11-0700

[[max_size]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

## max_size

Syntax:

        #include <string>
        size_type max_size() const;

The max_size() function returns the maximum number of elements that the string can hold. The max_size() function should not be confused with the size() or capacity() functions, which return the number of elements currently in the string and the the number of elements that the string will be able to hold before more memory will have to be allocated, respectively.

Related Topics: size

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •