1#include <array>
22 #include <iostream>
33
44 using namespace std;
55
66 //remember const!
77 const int ROWS = 2;
88 const int COLS = 3;
99
1010 void printMatrix(array<array<int, COLS>, ROWS> matrix){
1111 //for each row
1212 for (int row = 0; row < matrix.size(); ++row){
1313 //for each element in the current row
1414 for (int col = 0; col < matrix[row].size(); ++col){
1515 cout << matrix[row][col] << ' ';
1616 }
1717 cout << endl;
1818 }
1919 }
1void printMatrix(array<array<int, COLS>, ROWS> matrix){
2for (auto row : matrix){
3//auto infers that row is of type array<int, COLS>
4for (auto element : row){
5cout << element << ' ';
6}
7cout << endl;
8}