fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class test
  5. {
  6. public:
  7. template <size_t A, size_t B>
  8. void print(int (&mat)[A][B])
  9. {
  10. for (int i = 0; i < A; ++i)
  11. {
  12. for (int j = 0; j < B; ++j)
  13. {
  14. cout << mat[i][j] << " ";
  15. }
  16. cout << endl;
  17. }
  18. }
  19. };
  20.  
  21. int main()
  22. {
  23. int mat[3][2] = {{2,3},{4,5},{6,7}};
  24. test arr;
  25. arr.print(mat);
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 5476KB
stdin
Standard input is empty
stdout
2 3 
4 5 
6 7