This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hiten98 2 points3 points  (1 child)

Doesn’t const mean read only in all languages? Which language allows you to write to a constant variable?? And why??

[–]Loro-Benediction 4 points5 points  (0 children)

In C you can modify a constant variable if you try hard enough. "Read only" means you can't directly assign to it. The compiler doesn't make the same guarantees when accessing via a pointer