Consider the below code snippet:
int main() { const int i=3; int *ptr; ptr=const_cast(&i); *ptr=5; cout<<\"i= \"<&
Most likely since it is a const int, the compiler is optimizing and directly replacing it with the value of i.