C++ Vector resize()
It modifies the size of the vector to the specified value
Size changed to 4 and new value is
Consider a vector v. Syntax would be:
n : It is the new vector size.
val : If n is greater than the current vector size, then value(val) is inserted in the added space.
It does not return any value.
Let's see a simple example when n is less than the current vector size.
Initial elements are: 1 2 3 4 5 6 7 8 9 10 After resizing its size to 5, elementsare: 1 2 3 4 5
Let's see a simple example n is greater than the current vector size.
Elements of v1 are :java C C++ java C C++ .Net .Net