Howdy!
First look at the code.
Here is the code...
int **arrofptr;
arrofptr = (int **) malloc(sizeof(int*)*3);
arrofptr[0] = (int *)malloc(sizeof(int) * 4800);
arrofptr[1] = (int *)malloc(sizeof(int) * 4800);
arrofptr[2] = (int *)malloc(sizeof(int) * 4736);
Now my questions is when i execute the below statement
printf ("arrofptr = %p\n,arrofptr[0] = %p\narrofptr[1] %p\narrofptr[2] %p\n",arrofptr,arrofptr[0],arrofptr[1],arrofptr[2]);
it outputs
arrofptr = 0x0080C5F8
arrofptr[0] = 0x00000000
arrofptr[1] = 0x00000000
arrofptr[2] = 0x00000000
First malloc returning some address but other three mallocs returning 0x00000000. But the other three mallocs should return some address like first malloc.
why the other three mallocs are returning 0x00000000 ?
please help me to get rid of this problem.
Thanks in advance.