vector<int> *vec; allocate memory and
suppose vec conatins 10 values then
both should be used or any one one is fine to erase all ??
clear() removes all entries from a collection.
erase() can remove a single entry or a range of entries. In your example, the range is the entire content, so the effect is the same as clear().