To delete an element use the following way:
1 // declaring and assigning array1 2 std:vector<int> array1 {0,2,3,4}; 3 4 // erasing the value in the array 5 array1.erase(array1.begin()+n); forFor a more broad overview you can visit:- http://www.cplusplus.com/reference/vector/vector/erase/