One of the key differences between a vector
and an array
is that a vector
can dynamically grow to accommodate more elements. To demonstrate this, line 88 shows the current size of integers3
, line 89 calls the vector
’s push_back member function to add a new element containing 1000 to the end of the vector
and line 90 shows the new size of integers3
. Line 92 then displays integers3
’s new contents.