Answers for "looping 2 vector in c++"

C++
1

how to loop a 2 dimensional vector in c++ starting from second element

for(int i = 1; i < arr.size(); i++)
{
  for(int j = 1; j < arr[i].size(); j++)
  {
    cout << arr[i][j] << endl;
  }
}
Posted by: Guest on December-17-2021
0

iterate over 2 vectors c++

for (auto& [a, b] : zip(containerA, containerB)) {
    a = b;
}
Posted by: Guest on September-13-2020

Browse Popular Code Answers by Language