const int z = 10;
const int *x = &z;
*const_cast <int *> (x) = 1;
const int &ref = z;

const_cast<int &> (ref) = 15;

cout<< "z= " << z;
cout <<"*x ="<<*x;
cout << "ref = "<<ref;


Output seen

z = 10

*x = 15;

ref = 15

how can z be 10 if its reference and value at its address is 15. is a separate copy of z kept ?