Does the free function deallocate the memory of matrices of pointers?
Code:int **matrix; int i; matrix = (int **) malloc ( NUMBER ); for( i = 0 ; i < NUMBER ; i++ ) matrix[i] = (int *)malloc( ANOTHER_N ); } free(matrix);
Does the free function deallocate the memory of matrices of pointers?
Code:int **matrix; int i; matrix = (int **) malloc ( NUMBER ); for( i = 0 ; i < NUMBER ; i++ ) matrix[i] = (int *)malloc( ANOTHER_N ); } free(matrix);
Nothing more to tell about me...
Happy day =)
free memory occupied by ANOTHER_N and then free NUMBER.
Saravanan.T.S.
Beginner.