fork download
  1. #include <vector>
  2. #include <iostream>
  3.  
  4. int main(int argc, char const *argv[])
  5. {
  6. std::vector<std::vector<int> > foo(3, std::vector<int>(3, 1));
  7. std::vector<int>::iterator foo_it = foo[0].begin();
  8. std::cout << "*foo_it: " << *foo_it << std::endl;
  9. foo.push_back(std::vector<int>(3, 2));
  10. std::cout << "*foo_it: " << *foo_it << std::endl;
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 2964KB
stdin
Standard input is empty
stdout
*foo_it: 1
*foo_it: 1