Const Casting Not Working

Hi
I have written the following program

#include<iostream>
using namespace std;
int main()
{
const int a=10;
int *p=const_cast<int *>(&a);
*p=20;
cout << "Address " << p << " " << &a << endl;
cout << "Value " << *p << " " << a << endl;
return 0
}
My Addresses are same but values are different how is this possible?
ThanQ Bazzy
Topic archived. No new replies allowed.