Mail Archives: djgpp/1997/02/16/17:48:14
Tony O'Bryan wrote:
> I've written some small stuff using new and delete with Turbo C++.
> Deleting a
> NULL pointer caused my program to crash, so I advise checking for NULL
> before
> deleting anything.
The draft standard indicates that deleting a null pointer will have no
effect. Even if the _Annotated C++ Reference Manual_ reads, "The effect of
applying delete to a pointer not obtained from the new operator without a
placement specification is undefined and usually harmful. Deleting a point
with the value zero, however, is guaranteed to be harmless" (p. 63).
--
Erik Max Francis, &tSftDotIotE / email: max AT alcyone DOT com
Alcyone Systems / web: http://www.alcyone.com/max/
San Jose, California, United States / icbm: 37 20 07 N 121 53 38 W
\
"I am become death, / destroyer of worlds."
/ J. Robert Oppenheimer (quoting legend)
- Raw text -