Dynamically opens up a two-dimensional array of # include <stdio.h> #include <stdlib.h> int main () {int i = 0; int j = 0; int line = 0; int row = 0; int **p = NULL; printf ("Number of input lines:"); scanf ("%d", &line);p rintf ("\ n");p rintf ("Number of input columns:"); scanf ("%d", &row); printf ("\ n");//Apply the first pointer to all lines p = (int * *) malloc (line * sizeof (int *)); if (NULL = = p) {return;} for (i = 0, i < line; i++) {//Application column pointer * (p + i) = (int *) malloc (row *sizeof (int)); if (* (P + i) = = NULL) {return;}} Initialize array for (i = 0; i < line; i++) {for (j = 0; J < Row; J + +) {P[i][j] = i + 1;}}// output for (i = 0; I &l T Line i++) { for (j = 0; J < Row; J + +) {printf ("%d ", P[i][j]),}} printf ("\ n");// free memory for (i = 0; i < line; i++) {Free (* (P + i)), p[i] = NULL;} free (P); p = NULL; return 0;}
"C language" dynamically opens up a two-dimensional array