+ 1

Friend function in private section of class

Hi Refer code below: What's the use of access specifier for friend function? In other words, both class A and B works same even though A and B has friend function of overloaded << operator in private and public section... What's the difference? https://code.sololearn.com/c3XfZ707aGuP/?ref=app

24th Apr 2022, 7:05 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
1 Réponse
+ 2
Access specifiers have no effect on friend declarations, therefore there is no difference.
24th Apr 2022, 7:44 AM
Shadow
Shadow - avatar