A

Admin • 833.24K Points
Coach

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
  • Correct Answer - Option(D)
  • Views: 20
  • Filed under category C++
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.