We can iterate over two vectors in C++ using a simple for
loop with indexing.
//decleration of int vector
vector<int> vec1 = {1, 2, 3, 4, 5};
vector<int> vec2 = {6, 7, 8, 9, 10};
// returns length of vector as unsigned int
unsigned int vecSize = vec1.size();
// run for loop from 0 to vecSize
for(unsigned int i = 0; i < vecSize; i++)
{
cout << vec1[i] << " " << vec2[i] <<endl;
}