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