assigning const var to ref var's

const int i=10;
int &j=i;
Is this assignment correct.?
You could just compile and see..
It is not correct as constness is lost.
It should be const int& j = i;
Topic archived. No new replies allowed.