Mooophy / Cpp-Primer

C++ Primer 5 answers
Creative Commons Zero v1.0 Universal
8.06k stars 3k forks source link

[Ex 6.36, 6.37] Remove parameter #838

Closed iamvickynguyen closed 11 months ago

iamvickynguyen commented 11 months ago

Exercise 6.36 and 6.37

The problem asks to write the declaration for a function that returns a reference. It doesn't mention about taking an array as a parameter. One of the applications of the function that returns a reference without parameter is the getter function of a class. I suggest removing the unnecessary parameter to make the function declaration simpler and also to address the requirement.