fork(11) download
  1. #include <vector>
  2. #include <iostream>
  3.  
  4. int main() {
  5. std::vector<int> testVec{1, 2, 3, 4, 5};
  6. testVec.erase(testVec.begin() + 4, testVec.end());
  7. testVec.erase(testVec.begin(), testVec.begin() + 1);
  8. for (auto i : testVec) std::cout << i << ' ';
  9. return 0;
  10. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
2 3 4