The function resize() changes the size of the vector to num. If val is
specified then any newly-created elements will be initialized to have a value
of val. The contents of the vector up to num will remain unchanged.

Example:

vector<int> v;for(int i =0; i <10;++i ) v.push_back(i);
v.resize( 20, 0 );// adds an additional 10 zeros to the end of v