Program help

I'm working on a program to familiarize myself with pointers, but I'm having trouble with a function to delete a passed in pointer. Here's my code.

1
2
3
4
void destroyDynamicArray(double *&numbers) {
       delete [] numbers;
       numbers = NULL;
}


Simple, I know, but I figured it would work. It's a pointer to an array, hence the brackets. If anyone can help, I would certainly appreciate it.
I really can't figure this one out, guys. I use a ccmalloc program to check for memory leaks, and anytime this function is called, I get one... which I don't want to happen. Any advice would be great.
Topic archived. No new replies allowed.