bhadmanathan
Junior Member level 1
Hello experts,
I am having some doubts in Dynamic allocation of 2D array..
I understood the allocation using array of pointers.
int *arr[r];
for (i=0; i<r; i++)
arr = (int *)malloc(c * sizeof(int));
but having doubts in pointer to pointer..
int **arr = (int **)malloc(r * sizeof(int *));
for (i=0; i<r; i++)
arr = (int *)malloc(c * sizeof(int));
I dont understand what (int **arr) comes to tell...
Thanks in advance
I am having some doubts in Dynamic allocation of 2D array..
I understood the allocation using array of pointers.
int *arr[r];
for (i=0; i<r; i++)
arr = (int *)malloc(c * sizeof(int));
but having doubts in pointer to pointer..
int **arr = (int **)malloc(r * sizeof(int *));
for (i=0; i<r; i++)
arr = (int *)malloc(c * sizeof(int));
I dont understand what (int **arr) comes to tell...
Thanks in advance