std::vector<int> vect;
vect.erase(vect.begin());
// Deletes the first element from vector v
v.erase(v.begin());
// Deleting first element
vector_name.erase(vector_name.begin());
// Deleting xth element from start
vector_name.erase(vector_name.begin()+(x-1));
// Deleting from the last
vector_name.pop_back();
auto it = std::find(v.begin(),v.end(),3);
// check that there actually is a 3 in our vector
if (it != v.end()) {
v.erase(it);
}
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> nums;
nums.push_back(6);
nums.push_back(2);
nums.push_back(7);
nums.push_back(1);
nums.erase(nums.begin());
for (int num: nums)
cout << num << endl;
}