I have a vector like this:
std::vector<std::vector<char> > _lines;
I would like to iterate these vector and the vector contained within, however I’m not sure how I’d access the inside vector using the iterator of the first one?
I have the following already:
std::vector<std::vector<char> >::iterator first_iter = _lines.begin();
for (; first_iter != _lines.end(); first_iter++)
{
(*first_iter)::iterator second_iter = (*first_iter)->begin(); // something is wrong with this? How do I get the second vector to iterate?
}
If you use a modern compiler, you can use the C++0x feature
autoto deduce the type automatically: