data_vector is the vector. Since this is a vector<vector<data>> using two sets of brackets means that the data type must have a size member function.
data_vector.size(); // The size of the outer vector.
data_vector[0].size(); // The size inner vector of the first outer element.
data_vector[0][0].size(); // The size reported by the data class size() member function.
I of course understand that such advanced "programmers" as you will not use a compiler to prove own statement. So I did it using MS VC++ instead of you
main.cpp||In function ‘int main()’:|
main.cpp|14|error: request for member ‘size’ in ‘(& data.std::vector<_Tp, _Alloc>::operator[]<std::vector<int>, std::allocator<std::vector<int> > >(0u))->std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(0u)’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}’|
||=== Build finished: 1 errors, 0 warnings ===|
As you should be able to see an int doesn't have a size() member function.
Thanks for your answers! vlad was right, I needed to build my 3D vector properly before I tried to manipulate it.
The problem was that I had only declared it and hadn't built the thing properly before I started trying to use it in my program.
I got round this by pushing empty elements into a 1D vector, pushing that vector into a 2D vector and then taking that vector and pushing it into my original declaration.