Hi,
Please see the below code snipet, its giving segmentation fault while freeying array[i]. Anybody help in whats going wrong?
Thanks in adavance
Manjunath
Please see the below code snipet, its giving segmentation fault while freeying array[i]. Anybody help in whats going wrong?
Code:
void deallocate2D(int** array, int nrows) {
/* deallocate each row */
int i;
for(i = 0; i < nrows; i++) {
printf("deallocate each row %d\n",i);
free(array[i]);
}
/* deallocate array of pointers */
printf("deallocating array of pointers\n");
free(array);
}
Manjunath
Comment