data structures using int main(int **arrijrowscolsprintf("\ enter the number of rows and columns in the array")scanf("% % "rowscols)arr (int **)malloc(rows sizeof(int *))if(arr =nullprintf("\ memory could not be allocated")exit(- )for( = <rowsi++arr[ (int *)malloc(cols sizeof(int))if(arr[ =nullprintf("\ memory allocation failed")exit(- )printf("\ enter the values of the array")for( rowsi++for( colsj++scanf("% "&arr[ ][ ])printf("\ the array is as follows")for( rowsi++for( colsj++printf("% "arr[ ][ ])for( rowsi++free(arr[ ])free(arr)return herearr is pointer-to-pointer-to-intat the first level as it points to block of pointersone for each row we first allocate space for rows in the array the space allocated to each row is big enough to hold pointer-to-intor int if we successfully allocate itthen this space will be filled with pointers to columns (number of intsthis can be better understood from fig arr row column figure memory allocation of two-dimensional array