This may be too obvious, but initialize pArray to 0, and then set it back
to 0
after you do any deletes. Then test for 0 before you do a delete. I use
Win32's
GlobalReAlloc in these cases, so I don't have to copy over the data. You
might
look into using that for your case. - Doug S.
Quote:
> I have a common problem.
> I want to resize an array, but I don't know if this pointer exists or
> how
> big the array is right now. I.E.
> delete [] Array;
> Array = new double [ArraySize];
> How can I trap and correct for "trying to delete a non-existent array"
> errors?
> Pete
> --
> ///////////////////////////
> Peter B. O'Connor, Ph.D.
> Scientist
> IonSpec Corporation
> 16 Technology Drive, Suite 122
> Irvine, California 92618-2325
> Phone: (949) 753-1202 or (800) 438 - 3867
> Fax: (949) 753 - 9121
> //////////////////////////