The illustration shows a code segment with the lines numbered from 1 through 36 and the annotations are as follows:
"#include <iostream>
using namespace std;
typedef int* IntArrayPtr;
int main( )
{
int d1, d2;
cout << "Enter the row and column dimensions of the array:\n";
cin >> d1 >> d2;
IntArrayPtr *m = new IntArrayPtr[d1];
int i, j;
for (i = 0; i < d1; i++)
m[i] = new int[d2];
//m is now a d1 by d2 array.
cout << "Enter " << d1 << " rows of "
<< d2 << " integers each:\n";
for (i = 0; i < d1; i++)
for (j = 0; j < d2; j++)
cin >> m[i][j];
cout << "Echoing the two-dimensional array:\n";
for (i = 0; i < d1; i++)
{
for (j = 0; j < d2; j++)
cout << m[i][j] << " ";
cout << endl;
}
for (i = 0; i < d1; i++)
delete[] m[i];"
"delete[] m;" with the “for” block annotated as "Note that there must be one call to delete[ ] for each call to new that created an array. (These calls to delete[ ] are not really needed, since the program is ending, but in another context it could be important to include them.)"
"return 0;
}"
The lines from 12 to 16 with the code from:
“IntArrayPtr *m = new IntArrayPtr[d1];
int i, j;
for (i = 0; i < d1; i++)
m[i] = new int[d2];
//m is now a d1 by d2 array.” are highlighted.