Question: Write a C++ program that declares int variables x, y, z and int* pointer variables p, q, r. Set x, y, z to three different
Write a C++ program that declares int variables x, y, z and int* pointer variables p, q, r. Set x, y, z to three different values. Set p, q, r to the addresses of x, y, z respectively.
- Print with labels the values of x, y, z, p, q, r, *p, *q, *r.
- Print the message: Swapping pointers.
- Execute the swap code: r = p; p = q; q = r;
Step by Step Solution
3.39 Rating (149 Votes )
There are 3 Steps involved in it
Solution Code and output include include using namespace ... View full answer
Get step-by-step solutions from verified subject matter experts
