#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> v;
for (int i = 1; i <= 5; i++)
v.push_back(i);
v.reserve(50);
cout<<v.capacity();
return 0;
}
a) 10
b) 8
c) 50
d) 60
What will be the capacity of vector at the end in the following C++ code?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What will be the capacity of vector at the end in the following C++ code?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!