In the following code:
#include<iostream>
using namespace std;
int main()
{
const int i = 8;
int j = 90;
const_cast<int &>(i) = 10;
static_cast<const int&> (j);
j = 200;
cout << " i = " << i << endl;
cout << " j = " << j << endl;
}
I thought the output will be
i = 10
j = 90
But the actual output was
i = 8
j = 200
So the casting did not work ?