L
Luca
I have 2 questions:
1. Which one is the best: Returning member variables of the class by const
ref or returning by pointer?
e.g.:
Employee* GetEmployee() const;
Employee& GetEmployee() const;
2. Which one is best: Passing a variable by const ref or by pointer?
e.g.:
void SetSalary(Employee* e);
void SetSalary(const Employee& e);
Thanks
1. Which one is the best: Returning member variables of the class by const
ref or returning by pointer?
e.g.:
Employee* GetEmployee() const;
Employee& GetEmployee() const;
2. Which one is best: Passing a variable by const ref or by pointer?
e.g.:
void SetSalary(Employee* e);
void SetSalary(const Employee& e);
Thanks