Last active
August 29, 2015 14:11
-
-
Save LemonPi/aec09931d9d3409f7e3a to your computer and use it in GitHub Desktop.
2D array interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template <typename TwoD> | |
void print2D(const TwoD& mat, size_t m, size_t n) { | |
for (size_t row = 0; row < m; ++row) { | |
for (size_t col = 0; col < n; ++col) | |
std::cout << mat[row][col] << ' '; | |
std::cout << std::endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment