I have 2 vectors that only have 4 values in each of them. I want to loop through them and process them together, as the values in both vectors go together in those positions in the vectors.
for (std::vector<boost::filesystem::path>::iterator i = volumeVec.begin(); i != volumeVec.end(); ++i) {
for (std::vector<boost::filesystem::path>::iterator j = sliceHeaderVec.begin(); j != sliceHeaderVec.end(); ++j) {
ParseHeader(j->string(), i->string(), sourceDir);
}
}
However, when I run ParseHeader it process many more values then what I was expecting. I think I need to fix the arrangement of my for loops but don't know what to do
iandjwhile your text sounds as if you wantigoing from0to3andj==i