Apr 24, 2014 at 5:11pm
i have a Boolean function containing 2D dynamic array, it'll retain either 0 or 1, how can i delete the dynamic array?
1 2 3 4 5 6 7 8 9 10
|
bool something (int** a,int b, int c)
{
int **arr = new int*[b];
for(int i=0;i<b;i++)
arr[i]= new int[c];
if (...) return 0;
else ...
if (...) return 0;
}
|
Last edited on Apr 24, 2014 at 5:12pm
Apr 24, 2014 at 8:24pm
giblit, good catch :)
I was just demonstrating how to delete allocated memory and the example was not directly connected with his code.
But yes andriac, based on your code giblit is the full solution.
Take care.