2011-03-17 12 views

Respuesta

20
vec.resize(10); // drops the rest (capacity remains the same) 
4
theVector.erase(theVector.begin() + 10, theVector.begin() + 100); 
23

Sí, hay una función que toma erase argumentos para primero y el último.

v.erase(v.begin() + 10, v.end()); 
+0

gracias por este! –

5

vec.erase(vec.begin() + 10, vec.begin() + 100);

Cuestiones relacionadas