void printElements(int* arr,int r,int c){ for (int i = 0; i < r; ++i){ for (int j = 0; j < c; ++j){ cout<<( *((arr + i * c) + j))<<" "; } cout<<" "; } return; } // To call this function: printElements(*array, row, column);