Page 1 of 1

What happens if the following C++ statement is compiled and executed?

Posted: Wed Jul 13, 2022 7:50 pm
by answerhappygod
int *ptr = NULL;
delete ptr;
a) The program is not semantically correct
b) The program is compiled and executed successfully
c) The program gives a compile-time error
d) The program compiled successfully but throws an error during run-time