xxxxxxxxxx
void getElements(int* arr,int r,int c){
for (int i = 0; i < r; ++i){
for (int j = 0; j < c; ++j){
cin>>( *((arr + i * c) + j));
}
}
return;
}
// Calling this function:
getElements(*array, row, column);
xxxxxxxxxx
void printMatrix(array<array<int, COLS>, ROWS> matrix){
for (auto row : matrix){
//auto infers that row is of type array<int, COLS>
for (auto element : row){
cout << element << ' ';
}
cout << endl;
}