fork(2) download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. int main () {
  5. std::vector<int> vec {1, 2, 3, 4, 5, 6, 7, 8, 9};
  6. auto it = vec.begin();
  7. vec.insert(it + 3, 10);
  8. for (auto x: vec) {
  9. std::cout << ' ' << x;
  10. }
  11. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
 1 2 3 10 4 5 6 7 8 9