#include #include using namespace std; const size_t ROWS = 4; const size_t COLS = 3; void FillArray(int** ary); void PrintArray(int* ary[]); int main() { int **ary = new int* [ROWS]; size_t i; for (i = 0; i < ROWS; i++) { ary[i] = new int[COLS]; } FillArray(ary); PrintArray(ary); for(i = 0; i < ROWS; i++) { delete [] ary[i]; } delete [] ary; return 0; } void FillArray(int** ary){ size_t row, col; for(row = 0; row < ROWS; row++) { for(col =0; col < COLS; col++) { ary[row][col] = static_cast (row*COLS + col); } } return; } void PrintArray(int * ary[]){ size_t row, col; for(row = 0; row < ROWS; row++) { for(col =0; col < COLS; col++) { cout << setw(5) << ary[row][col] ; } cout << endl; } return; }