Reputation: 1464
vector<int> v[1000];
Is this for reserving space for the vector? But isn't the command for reserving space ()
? What does this do?
Upvotes: 3
Views: 115
Reputation: 118021
That is an array, with each element being a vector, so there are 1000 default-constructed (empty) vectors.
However, if you wanted to make a single vector of 1000 int
, you would say
vector<int> v(1000);
Upvotes: 13