This function modifies the capacity of the vector to match its size.
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.
C++ is renowned for its efficiency. Learn how C++ Vector Shrink To Fit Function enables low-level control and high-performance computing in the tutorial below.
This function modifies the capacity of the vector to match its size.
Consider a vector 'v'. Syntax would be:
v.shrink_to_fit();
It does not contain any parameter.
It does not return any value.