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

Code:
int *ptr = NULL;
delete ptr;
  • (A) The program is not semantically correct
  • (B) The program compiled successfully but throws an error during run-time
  • (C) The program gives a compile-time error
  • (D) The program is compiled and executed successfully
πŸ’¬ Discuss
βœ… Correct Answer: (D) The program is compiled and executed successfully

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
287
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Babita
Publisher
πŸ“ˆ
94%
Success Rate