2080 6

BIT153 ยท 2080 ยท 5 marks

What is friend function? Write a program to add private member of two different classes using friend function.

What is friend function? Write a program to add private member of two different classes using friend function. [5]

Object Oriented ProgrammingChapter 5: Function Features and Inline FunctionsFriend functions

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. It is declared inside the class using the keyword friend, but it is defined outside the class like a normal function. Key Points: - It is declared with the friend key...