R

Ranjeet • 34.60K Points
Instructor I

Q. Is it fine to call delete twice for a pointer?
#include
using namespace std;
int main()
{
int *ptr = new int;
delete ptr;
delete ptr;
return 0;
}

  • (A) Yes
  • (B) No
  • (C) none
  • (D) all
  • Correct Answer - Option(B)
  • Views: 26
  • Filed under category C++

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.


Question analytics