Saturday, 10 August 2013

How to initialize an array of vector in C++ with predefined counts?

How to initialize an array of vector in C++ with predefined counts?

Excuse me, I'm new in STL in C++. How can I initialize an array of 10
vector pointer each of which points to a vector of 5 int elements.
My code snippet is as follows:
vector<int>* neighbors = new vector<int>(5)[10]; // Error
Thanks

No comments:

Post a Comment