On which condition we can use it ?
What Is Friend Function in C++ ?
Collapse
X
-
Tags: None
-
A friend function of a cl*** is defined outside that cl***' scope but it has the right to access all private and protected members of the cl***. Even though the prototypes for friend functions appear in the cl*** definition, friends are not member functions.
Also A friend can be a function, function template, or member function, or a cl*** or cl*** template, in which case the entire cl*** and all of its members are friends
Comment