News for hackers. Stuff that matters.
Re:Const and Optimization in C by haberman on Monday July 25, 2016 @04:11AM (#12157179)
The key distinction is not variable vs function argument, but rather const variable vs pointer-to-const.

If you have "const int x" (as a local variable, global variable, or function parameter) then there is no valid way to modify x's value. But if you have "const int* y" (as a local variable, global variable, or function parameter), you can always cast away const and mutate as long as the original variable (the one "y" points to) wasn't declared const.

There are no comments on this comment yet.