I am working on a project and I have run into an issue with populating a 3d vector array. When I try to complile the code below I get the following error.
no matching function for call to ‘std::vector<std::vector<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >
I am not sure where I went wrong but any help with this would be greatly appreciated.
Here is my current code implementation.
vector<vector<vector<string> > > vec;
for (int i = 0; i < 3; i++) {
vector<string> row;
row.push_back("Row");
for(int j = 0; j < 5; j++){
vector<string>col;
col.push_back("\t\t COL");
vec.push_back(col);
}
vec.push_back(vec);
}
for(int k = 0; k < vec.size(); k++){
for(int l = 0; l < vec[k].size(); l++){
cout << vec[k][l] << endl;
}
}