// Steve J. Hodges // CS19: C++ Programming Fall 2005 // 2dDynamicArray.cpp two dimensional dynamic (run-time) array demo #include using std::cout; using std::cin; using std::endl; // a function with a (run-time sized) 2d array parameter void print2dArray(int**, int, int); main(){ int simple[5][5]; // compile-time sized 2d arrays are simple simple[3][4] = 100; int **myArray; // a run-time sized 2d has trickier initialization syntax int c, r; // number of columns and rows for our array cout << "CS19: Simple Two Dimensional Array Demo" << endl; cout << "Enter number of columns:"; cin >> c; cout << "Enter number of rows:"; cin >> r; cout << endl; // initialize a run-time sized two dimensional array myArray = new int*[r]; // create first dimension (of pointers to 2nd dimension) for (int i=0; i