C and C++ "const" is weird because it's not constant, it's just a weird name for immutable - K&R C doesn't have const, it's an invention of C++ and thus modern C.
Bjarne's book calls these immutable variables "constants" which is completely crazy, but I guess indicates that the name is on purpose. This leads to the usual C++ insanity shortly afterwards in the book...
> An object that is a constant when accessed through one pointer may be variable when accessed in other ways.
Yeah, no. If the object were actually constant you can't do that, your language has betrayed the poor programmer. You can't "access" constants, you can use them to initialize variables, parameters, and so on, but they can't be "accessed" and that's where you've gone wrong here.
Rust's Quiz has a example showing what happens with actual constants, and it's not that