C++: working with vectors

Example:

vector v = {1, 2, 3, 4, 5};
Vectors are sequence containers representing arrays that can change in size.

Solution:

v.push_back(6);  // Adds 6 to the end

Beginner's Guide to C++