Skip to main content
2 of 2
Removed line numbers for easy copy and pasting
rayryeng
  • 104.9k
  • 22
  • 201
  • 206

To delete an element use the following way:

// declaring and assigning array1 std:vector<int> array1 {0,2,3,4}; // erasing the value in the array array1.erase(array1.begin()+n); 

For a more broad overview you can visit: http://www.cplusplus.com/reference/vector/vector/erase/

cammando
  • 616
  • 8
  • 21