2078 7

CSC166 ยท 2078 ยท 5 marks

What is the concept of friend function? How it violates the data hiding principle? Justify with example.

What is the concept of friend function? How it violates the data hiding principle? Justify with example. [5]

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

A friend function is a non-member function that is granted special access to the private and protected members of a class. Although it is not a member of the class, it can access all private and protected data of that class as if it were a member. The declaration of a friend function is made insi...