why the object pass to the friend function in declaration is different from invocation? (declaration with & and calling without & operator) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why the object pass to the friend function in declaration is different from invocation? (declaration with & and calling without & operator)

23rd Jun 2016, 10:37 PM
Hosein Aghajani
Hosein Aghajani - avatar
3 Answers
+ 1
To change any variable in a class if wanted then we should use & operator
9th Jul 2016, 1:23 PM
Desik
Desik - avatar
0
when & is used any change in function variable will also result in change in the actual variable. When & is not used the actual variable only passes value and does not undergo any change.
8th Jul 2016, 5:29 PM
Athreyan MKS
Athreyan MKS - avatar
0
when & is used. Funtion will point to address on memory and make change valiable when funtion change
15th Jul 2016, 8:26 AM
Loc