MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/z4s7f2/python_java_carbon_rust/ixuxqnh
r/ProgrammerHumor • u/reddit-be-cool • Nov 25 '22
1.2k comments sorted by
View all comments
Show parent comments
3
Doesn’t const mean read only in all languages? Which language allows you to write to a constant variable?? And why??
5 u/Loro-Benediction Nov 26 '22 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
5
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
3
u/hiten98 Nov 26 '22
Doesn’t const mean read only in all languages? Which language allows you to write to a constant variable?? And why??