fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. vector<int> v(20);
  9.  
  10. cout << "size" << v.size() << endl;
  11.  
  12. cout << "resize to 15" << endl;
  13. v.resize(15);
  14.  
  15. cout << "new capacity " << v.capacity() << endl;
  16. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
size20
resize to 15
new capacity 20