delete arrays

Hi,

I have an api function which requires an array in the form double[][4].

I have initialized an the variable as follows.

double (*CV)[4]=new double [count][4];

I am deleting the array by

delete [] CV;

Please let me know if I am doing the delete correctly.
Last edited on
Yes, it is correct.

1
2
3
4
5
6
int main()
{
    int count = 100;
    double (*CV)[4] = new double [count][4];
    delete[] CV;
}


==26635== HEAP SUMMARY:
==26635==     in use at exit: 0 bytes in 0 blocks
==26635==   total heap usage: 1 allocs, 1 frees, 3,200 bytes allocated
==26635==
==26635== All heap blocks were freed -- no leaks are possible
@ Cubbi

how do you get the heap summary?
Last edited on
That was valgrind output: http://valgrind.org/
Thank you.
Topic archived. No new replies allowed.