how to iterate over 2d vector c++ code example
Example: how to iterate over 2d vector c++
#include
#include
using namespace std;
/*
Iterate over vector of vectors and for each of the
nested vector print its contents
*/
template
void print_2d_vector(const vector< vector > & matrix)
{
for(auto row_obj : matrix)
{
for (auto elem: row_obj)
{
cout<