Hi guys,
I understand the difference is that the params of ctor 2 are declared const with n being passed by reference.
However, I don't seem to understand what difference having these params (n and a) declared constant with n being passed by reference makes?
I mean, I'd understand the effect if the private members of 'name' and 'age' were declared constant, just not why n/a are?
Person(string n, int a) : name(n), age(a) {} // ctor 1
Person(const string &n, const int a) : name(n), age(a) {} // ctor 2