What does this mean in vectors in C ++?

vector<int> v[1000];

      

Is this for reserving space for the vector? But isn't that a command to reserve space ()

? What does it do?

+3


source to share


1 answer


It is an array, each element of which is a vector, so there are 1000 default (empty) vectors.

However, if you wanted to make one vector 1000 int

, you would say



vector<int> v(1000);

      

+13


source







All Articles