reserve [C++ Reference]
Keywords: string,reserve
Date: 2009-10-08T22:30:14-0700

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

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## reserve

Syntax:

        #include <string>
        void reserve( size_type size = 0 );

The reserve() function sets the capacity of the string to at least size. A call of reserve() without an argument is a nonbinding shrink-to-fit request. reserve() runs in linear time.

Related Topics: capacity

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