InterviewSolution
Saved Bookmarks
| 1. |
What Is Friend Function In C++? |
|
Answer» As the name SUGGESTS, the function acts as a FRIEND to a class. As a friend of a class, it can access its private and protected MEMBERS. A friend function is not a member of the class. But it MUST be LISTED in the class definition. As the name suggests, the function acts as a friend to a class. As a friend of a class, it can access its private and protected members. A friend function is not a member of the class. But it must be listed in the class definition. |
|