bolkin

Untitled

Jul 24th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cat > test.cpp <<DELIM
  4. #include <iostream>
  5. #include <vector>
  6. using namespace std;
  7. main()
  8. {
  9. cout << "start" << endl;
  10. vector<int> v1,v2,v3;
  11. for (int i=0;i<300;i++) {
  12. v1.push_back(i);
  13. v2.push_back(i);
  14. }
  15. v3.reserve(300*2);
  16. v3.clear();
  17. for (int i=0;i<300;i++) {
  18. v3.push_back(v1[i]);
  19. v3.push_back(v2[i]);
  20. }
  21. cout << "finish" << endl;
  22. return 0;
  23. }
  24. DELIM
  25.  
  26.  
  27. g++ test.cpp -o t;valgrind ./t
Advertisement
Add Comment
Please, Sign In to add comment