Why does he say that "push_back" has not been declared?
6 answers
v[0]is a reference to the source element in vector; it is not himself vector. An element has a type intthat is not an object of the class type and therefore has no member functions.
Are you looking for v.push_back(0);?
Notice what vector<int> v(30);creates vectorwith 30 elements in it, each with a value of zero. The call v.push_back(0);will increase the size vectorto 31. This may or may not be the behavior you want; if this is not the case, you need to clarify what exactly you are trying to do.
+14