Multiple choice technology programming languages

Return size of allocated storage

  1. length

  2. size

  3. max_size

  4. capacity

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In C++ standard library containers (like std::vector), 'capacity' returns the total number of elements that the container can hold in its currently allocated storage. 'size' returns the number of actual elements, and 'max_size' is the absolute limit.