vec8.cpp

We use cookies. Read the Privacy and Cookie Policy

vec8.cpp

#include ‹iostream.h›

#include ‹stl.h›

int main() {

 vector‹int› v;

 cout ‹‹ "capacity = " ‹‹ v.capacity() ‹‹ endl;

 v.push_back(42);

 cout ‹‹ "capacity = " ‹‹ v.capacity() ‹‹ endl;

 v.reserve (5000);

 cout ‹‹ "capacity = " ‹‹ v.capacity() ‹‹ endl;

 return 0;

}