print 2d array in c++ code example
Example 1: print 2d vector c++
for(int i=0; i<v.size(); i++)
for(int j=0; j<v[i].size(); j++)
cout<<v[i][j]<<" ";
cout<<endl;
Example 2: print 2d array c++
for( auto &row : arr) {
for(auto col : row)
cout << col << " ";
cout<<endl;
}