Vector Capacity vs size
#include <iostream> #include <vector> using namespace std; int main() { vector<char> vectorObject(10); cout << "Initial size: " << vectorObject.size() << endl; cout << "Initial capacity: " << vectorObject.capacity(); cout << "\n\n"; vectorObject.reserve(20); // reserve more space cout << "Size after reserve: " << vectorObject.size() << endl; cout << "Capacity after reserve: " << vectorObject.capacity(); cout << "\n\n"; return 0; }