template < int M, int N > void printMat(int (&mat) [M][N]) { for (int i=0; i < M; i++) { for (int j=0; j < N; j++) { std::cout << mat[i][j] << "\t"; } std::cout << std::endl; } return; }
29 March, 2012
pass 2D array in C++ functions/c++中调用函数时传递2维数组
Subscribe to:
Posts (Atom)