2.4
Copied!
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> vec;
cout << "Real size of array in vector: " << vec.capacity() << endl;
for (int j = 0; j < 25; j ) {
vec.push_back(10);
}
cout << "Real size of array in vector: " << vec.capacity() << endl;
system("pause");
return 0;
}
Run on cpp.sh
Copied!