lpetrich
Contributor
In C++ and also in plain C, another useful keyword is const - on a function arg, it states that that arg's contents should not be modified by the function is that arg is a pointer or a reference. It can also be used for variables set at run time but not modified afterward, as a way of avoiding bugs. It can even be used on methods: put "const" after the declaration of a method and you are stating that the method is not to modify the object's variables, though it can modify the method's inputs.
Some recent langs don't do variable as default. Swift makes one declare with let (constant) or var (variable). With Rust, it's let (constant) or let mut (variable). mut = mutable.
Some recent langs don't do variable as default. Swift makes one declare with let (constant) or var (variable). With Rust, it's let (constant) or let mut (variable). mut = mutable.