Should a friend function be declared as public, protected or private?


The friend functions are inherently public and so, are accessible from anywhere in the file. The compiler ignores the access specifier in case of the friend function. However, it is most logical to declare them as public.

Subscribe / Share

It's very calm over here, why not leave a comment?

Leave a Reply




Categories

Powered by Yahoo! Answers