What is a friend function?
1 Like
We already know that private members are accessed only within the class they are declared in.
Friend function is used to access the private and protected members of different classes by working as a bridge between classes.
It must be declared with friend keyword and is invoked like normal function, without any object