fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. vector<int> test;
  7. test.push_back(1);
  8. test.push_back(2);
  9. test.push_back(3);
  10.  
  11. for (unsigned int i = 0; i < test.size(); i++)
  12. cout << "Val [" << test[i] << "]" << endl;
  13.  
  14. test.erase(test.begin());
  15.  
  16.  
  17. for (unsigned int i = 0; i < test.size(); i++)
  18. cout << "Val [" << test[i] << "]" << endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Val [1]
Val [2]
Val [3]
Val [2]
Val [3]