I can see why you’re having trouble with this pointer variable: it isn’t one. It is a reference.
You cannot have a non-const
reference to a const
thing. That would violate the const
, and allow the n = 11
line to succeed, thus again violating the original const
.
const
means “I cannot and will not change this thing any more”.
For more information, turn to the page in your C++ book about const
.
solved Please explain the following code in detail [closed]