Interview Questions

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

C++ Interview Questions and Answers


(Continued from previous question...)

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

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

(Continued on next question...)

Other Interview Questions