Passed by Value:
int MultiplyByTwo(int i) {
i = 2*i;
return i;
}
Passed by Reference:
int MultiplyByTwo(int &i) {
i = 2*i;
return i;
}
const
: The variable can only be evaluated at run time, but I promise not to change it after it is initialized.
constexpr
: The variable can be evaluated at compile time, and I promise not to change it after it is initialized.