2080 6

CSC166 ยท 2080 ยท 5 marks

Explain about friend function and friend class with an example.

Explain about friend function and friend class with an example. [5]

Object Oriented ProgrammingChapter 6: Virtual Function, Polymorphism, and miscellaneous C++ FeaturesFriend function and Static function

A friend function is a function that is not a member of a class but has access to the private and protected members of that class. - The declaration is placed inside the class body (in either private or public section) preceded by the keyword friend - It is not a member function, so it is called ...