Anything wrong with this code? T *p = 0; delete p;

Q

Anything wrong with this code?
T *p = 0;
delete p;

✍: Guest

A

Yes, the program will crash in an attempt to delete a null pointer.

2012-03-05, 4338👍, 0💬