How does a friend function access the data member?
Answers
Answered by
1
Answer:
A friend function cannot access the private and protected data members of the class directly. It needs to make use of a class object and then access the members using the dot operator. A friend function can be a global function or a member of another class.
Similar questions