// Update a variable using a pointer
#include <iostream>
using namespace std;

int main ()
{
  int i, *ptr;
  
  i = 10;
  cout << " i = " << i <<endl;
  cout << " Address of i " << &i <<endl<<endl;  

  ptr = &i;
  
  cout << " Using pointer, i = "<< *ptr <<endl;
  cout << " Using pointer, Address of i = " << ptr << endl<<endl;
  cout << " Pointers address = " << &ptr <<endl<<endl;


  cout << " I dublicate the value of the variable using ptr " << endl;
  *ptr *= 2;
  cout << " i = " << i <<endl;
  cout << " Address of i " << &i <<endl<<endl;  


  return 0;
}

