What is the difference between the various usages of the const keyword in the function header/prototype?
const int function(const int x) const;
Answer:
The 1st const is to return by constant value shown here.
The 2nd const is to have a constant function parameter shown here.
The 3rd const is used when the function is a class method/function that should only perform some sort of query operation such as get, hence should not change any of the class attributes/data variables shown here.