Possible Duplicate:
Const correctness for value parameters
I consider a good coding practice the following. When a parameter is passed to a function by value, it should only be read, but not modified (or reused) in the function body. But is it actually a good practice?
Example (of what I avoid doing):
int foo(int x){
//do lots of cool stuff
x = 69;
//do even cooler stuff
}
From here on we get to const correctness. Provided that my practice is good follows that nearly every argument to every function should be preceded by a "const". Actually "a" is optimistic:
class A{
const int gnoo(const int *const, const double) const;
};