2

Possible Duplicate:
Is there any reason to check for a NULL pointer before deleting ?

Is there a bug in this code

Type * p = 0;
delete p;

p is a null pointer here. will there be any issues in implementing this.

Community
  • 1
  • 1
cathy
  • 21
  • 1

1 Answers1

4

No, it's specified in the C++ specification that delete on a null pointer does nothing.

orlp
  • 106,415
  • 33
  • 201
  • 300