Chapter 2
Functions
Section 7
Const Parameters and Default Arguments
In pass by value, the function parameter is a value type: when invoked, the argument is copied into the parameter. This means that regardless of whether const is used in the parameter or not, the calling code cannot see the difference. The only reason to use const in the function signature is to document to the implementation that it cannot modify such a value. Let us learn this in detail through examples.