fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. vector<int> vec;
  7. vec.push_back(1);
  8. vec.push_back(2);
  9. vec.push_back(3);
  10.  
  11. int *ptr = &vec[1];
  12.  
  13. cout << *ptr;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
2