cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
array of vector<int>
array of vector<int>
Jun 29, 2011 at 2:49am UTC
nguyentrang
(21)
vector<
int
> v(5)
creates a vector<int> v of size 5
vector<
int
> v[5]
creates an array v of 5 vector<int>'s
What if we want an array v of 5 vector<int>'s of size 5?
Jun 29, 2011 at 3:13am UTC
helios
(17574)
In general, it's not possible to pass parameters to constructors of objects in arrays. In this particular case, this
may
work (I wouldn't be surprised if it didn't):
std::vector<
int
> v[]={5,5,5,5,5};
Topic archived. No new replies allowed.