Question: What is the output produced by the following code? int *p1, *p2; p1 = new int; p2 = new int; *p1 = 10; *p2 =
What is the output produced by the following code?
int *p1, *p2; p1 = new int; p2 = new int; *p1 = 10; *p2 = 20; cout << *p1 << " " << *p2 << endl; *p1 = *p2; //This is different from Exercise 2 cout << *p1 << " " << *p2 << endl; *p1 = 30; cout << *p1 << " " << *p2 << endl;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
