C++ String reserve()This function requests a change in capacity. SyntaxConsider a string str and l is planned length of the string. Its syntax would be: Parameterl is the planned length for the string Note: capacity of the string can be greater than or equal to 'l'.Return valueIt does not return any value. ExampleLet's see the simple example. Output: Capacity is 27 Now,capacity is : 54 In this example, we observe that how capacity of the string varies using reserve() function.
Next TopicC++ Strings
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week