fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. std::vector<int> v;
  8. v.reserve(5);
  9. new (&v[2]) int(17);
  10. cout << v[2] << endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
17