Question: Question 1 3 ( 2 points ) int * p t r 1 = new int ( 5 ) ; * p t r 1

Question 13(2 points)
int*ptr1= new int(5);
*ptr1=10;
delete ptr1;
*ptr1=6;
What will be the behavior of the above C++ code?
A. The code will compile without any error
B. The code will not compile due to a syntax error
C. The code will compile but result in a run time error while assigning 6 to ptr1
D. The code will not compile and there will be memory leak
Question 1 3 ( 2 points ) int * p t r 1 = new int

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!