Is ‘const’ necessary in function parameters when passing by value? [duplicate]
First, it’s just an implementation detail, and if you put const there, don’t put it in the declaration set (header). Only put it in the implementation file: // header void MyFunction(int age, House &purchased_house); // .cpp file void MyFunction(const int age, House &purchased_house); { … } Whether or not a parameter is const in a … Read more