When I use resize(int newsize)
in C++ for vector
, it means that the size
of this vector
are set to newsize
Haven't you read at MSDN:-
A list is a resizable collection of items. Lists can be constructed multiple ways, but the most useful class is List. This allows you to strongly type your list, includes all of the essential functionality for dealing with collections, and can be easily searched.
Further:-
Capacity is the number of elements that the List can store before resizing is required, while Count is the number of elements that are actually in the List.
Capacity is always greater than or equal to Count. If Count exceeds Capacity while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements.