Capacity

Suman Barik
0

Capacity

 
  1. size() – Returns the number of elements in the vector.
  2. max_size() – Returns the maximum number of elements that the vector can hold.
  3. capacity() – Returns the size of the storage space currently allocated to the vector expressed as number of elements.
  4. resize(n) – Resizes the container so that it contains ‘n’ elements.
  5. empty() – Returns whether the container is empty.
  6. shrink_to_fit() – Reduces the capacity of the container to fit its size and destroys all elements beyond the capacity.
  7. reserve() – Requests that the vector capacity be at least enough to contain n elements.
Tags

Post a Comment

0Comments
Post a Comment (0)