mardi 9 août 2016

How to erase element from std::vector<> by index?

I have a std::vector, and I want to delete the n'th element. How do I do that?

std::vector<int> vec;

vec.push_back(6);
vec.push_back(-17);
vec.push_back(12);

vec.erase(???);

Please help!

Aucun commentaire:

Enregistrer un commentaire