Question: #include // required to use cout, cin, and endl #include // required to setw() using namespace std; // required to use the items defined in

 #include // required to use cout, cin, and endl #include //

#include // required to use cout, cin, and endl #include // required to setw() using namespace std; // required to use the items defined in the above libraries

void print(int ** table, int maxrow, int maxcol);

int main() { int ** grid; // pointer to a pointer to integers to create the grid int *element; // pointer to an int to move through the row int col; // loop control variable int row; // control variable int maxr, maxc; // maximum number of rows and columns that the dynamic array will have char ans;

do { system("cls"); cout > maxr >> maxc;

grid = new int*[maxr]; // create a dynamic arrays of POINTERS TO INTEGERS with maxr elements cout

for (int row = 0; row

for (row = 0; row > ans; } while (ans == 'y' || ans == 'Y');

return 0; }

void print(int ** table, int maxrow, int maxcol) // receives the pointer to the grid and the max number of rows and columns to display { int row, col; for (row = 0; row In this exercise, you have to modify the provided implementation of a grid using pointers (see figure 1) so that it is implemented as shown in figure 2. Figure 1 Figure 2 In the implementation of Figure 1 the array of pointers is used to access the rows of the grid while in the implementation of Figure 2 the array of pointers is used to access the columns

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!