Question: what is the difference between the size and capacity of a vector?
Answer: The size of a vector is the number of elements that it contains, which is directly controlled by how many elements you put into the vector. Capacity is the amount of space that the vector is currently using. ... The capacity of the vector is the size of that array. This is always equal to or larger than the size.