What is a friend function? what are the merits and demerits of using friend functions?
Answers
Answered by
0
A friend function is declared by the class that is granting access, so friend functions are part of the class interface, like methods. Friend functions allow alternative syntax to use objects, for instance f(x) instead of x.f(), or g(x,y) instead of x.g(y). Friend functions have the same implications on encapsulation as methods
I know only friend function
I know only friend function
Similar questions
Accountancy,
8 months ago
English,
8 months ago
English,
8 months ago
Business Studies,
1 year ago
Social Sciences,
1 year ago
Physics,
1 year ago