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++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -