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

d. B and C

Computer Science & Information Technology

You might also like to view...

To format the elements of a PowerView object, select the object and then click the ________ tab

A) LAYOUT B) FORMAT C) VISUALIZATION D) DESIGN

Computer Science & Information Technology

The ________ worksheet displays the entire change history

A) Review B) History C) Changes D) Tracking

Computer Science & Information Technology