Vector Class:
-
Like an array, it is a direct-access container.
The use of an index allows a programmer to select any item in the array
without referencing any of the other items.
-
An array has a fixed-sized storage structure. A vector
container can be dynamically resized.
-
Vector can be passed by value or reference (with &)
Review for Array:
-
Array name is a pointer that stores the address of the first
element of its own array.
- We always pass array by reference without & since array name is a pointer.
-
There is no assignment of one array to another. A loop
is required for the assignment of one element to another.
Declare a Vector Object
Resize a Vector
Add & Remove Vector Elements
A document download
from MicroSoft web-site