// p2.cpp #include using namespace std; int main() { int* x, * y, * z; x = new int; *x = 3; cout << "The pointer variable x is stored at " << &x << endl; cout << "The pointer variable x has value " << x << endl; cout << "The value at that location is " << *x << endl; y = new int; *y = 4; cout << "The pointer variable y is stored at " << &y << endl; cout << "The pointer variable y has value " << y << endl; cout << "The value at that location is " << *y << endl; z = x; cout << "The pointer variable z is stored at " << &z << endl; cout << "The pointer variable z has value " << z << endl; cout << "The value at that location is " << *z << endl; x = y; cout << "The pointer variable x is stored at " << &x << endl; cout << "The pointer variable x has value " << x << endl; cout << "The value at that location is " << *x << endl; delete z; delete y; cout << "The pointer variable x is stored at " << &x << endl; cout << "The pointer variable x has value " << x << endl; cout << "The value at that location is " << *x << endl; return 0; }