Original Post
I'm working on writing a class which allocates memory dynamically using new and delete. My question is, if a certain pointer variable might have been used to allocate memory with new, how can I make sure it's cleared before using it to allocate something else? I thought before that there was no harm in using delete if it had been used once already, but I'm getting an error when I try. I suppose it's significant to mention that I'm using delete[] for an array, not a scalar.