// more pointers
#include <iostream>
using namespace std;

int main ()
{
int firstvalue = 5, secondvalue = 15;
int * ptr1, * ptr2;

ptr1 = &firstvalue; // ptr1 = address of firstvalue
ptr2 = &secondvalue; // ptr2 = address of secondvalue

*ptr1 = 10; // value pointed by ptr1 = 10
*ptr2 = *p1; // value pointed by ptr2 = value pointed by p1

ptr1 = ptr2; // ptr1 = ptr2 (value of pointer is copied)
*ptr1 = 20; // value pointed by ptr1 = 20

cout << "firstvalue is " << firstvalue << endl;
cout << "secondvalue is " << secondvalue << endl;

return 0;
}
