What happens if the following C++ statement is compiled and executed?
int *ptr = NULL;
delete ptr;
int *ptr = NULL;
delete ptr;A. The program compiled successfully but throws an error during run-time
B. The program gives a compile-time error
C. The program is not semantically correct
D. The program is compiled and executed successfully
Answer: Option D

Join The Discussion