Why it is giving the error i have declare vector in predefine and erase it then?
how to erase all element of vector
you have to use .clear() method to erase all elements in the vector i.e. empty the vector
for more detailed info refer this :-
http://www.cplusplus.com/reference/vector/vector/clear/