G
Gajanan Bhat
Hi,
When i run this piece of code.....i get the following result...
const int w = 10;
int * wp = const_cast<int *> (&w);
*wp = 20;
cout << w << endl << &w << endl << wp << endl << *wp << endl;
Output :
10
0012F58C
0012F58C
20
can any1 explain y this happens even though &w and wp
are the same?
Gajanan
When i run this piece of code.....i get the following result...
const int w = 10;
int * wp = const_cast<int *> (&w);
*wp = 20;
cout << w << endl << &w << endl << wp << endl << *wp << endl;
Output :
10
0012F58C
0012F58C
20
can any1 explain y this happens even though &w and wp
are the same?
Gajanan