Skip to content

Instantly share code, notes, and snippets.

@LemonPi
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LemonPi/aec09931d9d3409f7e3a to your computer and use it in GitHub Desktop.
Save LemonPi/aec09931d9d3409f7e3a to your computer and use it in GitHub Desktop.
2D array interface
#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