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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -