A

Admin • 833.24K Points
Coach

Q. Is it fine to call delete twice for a pointer?
#include<iostream>
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: 30
  • 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.