Write a c++ program to illustrate a user to use a vector container in a program and to process the elements into a vector container.
- Declares
intList to be a vector container of size 0.
- Add elements into
intList, use the function push_back with the value of your birthday e.g. day: 2, month: 10, year: 1992
- Print out all the elements in list.
- Declare
listIter to be an iterator into a vector container of type
int.
- Use for loop to list the elements of
intList onto the standard output device using iterator.
- Delete the last element in the
intList
- Initializes the iterator
listIter to the first element of
intList.
- Advance
listIter to the second and third element of
intList
- Insert the value of year 2014 at the position specified by
listIter
- Use for loop to list the elements of
intList onto the standard output device.