Does
int x = 5;
and
const int cx = 5;
do anything differently at the hardware level? I've never understood that.
In other words, if I declared int x = 5;
and then never tried to use x
as an l-value anywhere else in my code, would it compile the exact same as if I had declared x
constant? Is it just a protection against careless programming?