vector - C++ push_back method -
i don't understand why error in definition of methode "add". here code:
enum colour {empty = 0, red, yellow}; class game{ public: void add(size_t, colour const&); private: vector<vector<colour>> tab; }; void game:: add(size_t column, colour const& colour) { tab[0][column].push_back(colour); }
if tab
uninitialized cannot access index in
tab[0][column].push_back(colour);
.
Comments
Post a Comment