I am trying to initialize an array of vectors. How can I do that ?
The following code is wrong:
vector<int> A[] = vector<int>()[10];
I am trying to initialize an array of vectors. How can I do that ?
The following code is wrong:
vector<int> A[] = vector<int>()[10];
std::array<std::vector<int>, 10>
This will gives you an array of 10 with vectors in it.
Try just
vector<int> A[10];
It will default-initialize all ten vector
objects.