C++ Vector Shrink To Fit Function

This function is used to change the capacity of the vector and makes it equal to the size of the vector.

Syntax

Consider a vector 'v'. Syntax would be:

Example

v.shrink_to_fit();

Parameter

It does not contain any parameter.

Return value

It does not return any value.

Input Required

This code uses input(). Please provide values below: