c++ - how to initialize the size of a two dimensional vector -


i trying initialize size of 2 dimensional vector way:

 vector<vector<int> >  a(10, vector<int>) ; 

but when compile error:expected primary-expression before ')' token

why? correct way it?

in code vector defined inside structure. realise if define outside of structure problem disappears... why? need define in struct

perhaps

class inner : public vector<int> {    public:       inner() : vector<int>(10) { }; };  class outer : public vector<inner> {    public:       outer() vector<inner>(10) {  }; }; 

then

 outer a; 

should work.


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -