Multiple Choice
What is wrong with the following code fragment?
Int *p1, *p2;
P1 = new int;
P2 = new int;
*p1=11;
*p2=0;
P2=p1;
Cout << *p1 <<" " << *p2 << endl;
Delete p1;
Delete p2;
A) nothing
B) p1 and p2 both have the same value, so the delete p2 will cause an error
C) You have a memory leak.
D) B and C
Correct Answer:

Verified
Correct Answer:
Verified
Related Questions
Q29: If p1 and p2 are both pointers
Q30: In the statement cout << *p1;, the
Q31: Given that p1 is a pointer, p1++<br>A)
Q32: Given that p1 is an integer pointer
Q33: The & operator is called the _
Q35: What is the output of the following
Q36: int *p1; declares a static variable.
Q37: Dynamic variables are created from the _.
Q38: If two pointer variables point to the
Q39: Which of the following correctly declares a