In the overload function, shouldn't the parameter be 'obj' instead of '&obj'?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

In the overload function, shouldn't the parameter be 'obj' instead of '&obj'??

4th Mar 2017, 6:48 PM
Xin Xu
Xin Xu - avatar
2 Answers
+ 2
Its a parameter, it can be named anything
4th Mar 2017, 6:59 PM
Meharban Singh
Meharban Singh - avatar
0
Thanks. I've away from c++ for years and try use this course to refresh my memory. Now back to the question, if there's a ampersand symbol before the name, in the code it should use obj->var instead of obj.var ? I guess &obj is a reference instead of pointer?
4th Mar 2017, 10:21 PM
Xin Xu
Xin Xu - avatar