What is the difference betwen function membre and function friend ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the difference betwen function membre and function friend ??

13th Dec 2016, 6:05 PM
five stars
2 Answers
+ 1
you mean class member. a class member gets an exicit pointer to the object it belongs to ('this' pointer). a friend function is not part of the class, and you must supply it with an explicit pointer to the class instance you want the friend function to access.
13th Dec 2016, 7:07 PM
Udi Finkelstein
Udi Finkelstein - avatar
0
functions are the member of the class have specific assigned task it just act like normal function, function are called using instance of class friend it special keyword which gives the all access to a friend function or friend class from out side of the class but Friend functions are not member of the class
13th Dec 2016, 7:24 PM
Mock
Mock - avatar