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
Business Studies,
1 month ago
English,
3 months ago
English,
3 months ago
Music,
10 months ago
Chemistry,
10 months ago