i'm using the gcc compiler for windows and when running the following program
it turns out that &i == ip but i = 100 and *ip = 110. Surely i have missed something about const_cast. Can somebody tell me more? Thanks anyway.Code:#include <iostream> using namespace std; int main() { const int i = 100; int *ip = const_cast<int *>(&i); *ip = 110; cout << &i << endl; cout << ip << endl; cout << i << endl; cout << *ip; }