1.

What is meant by the Friend function in C++?

Answer»
  • A friend() FUNCTION is a function that has access to private and PROTECTED members of another CLASS i.e., a class in which it is declared as a friend. It is POSSIBLE to declare a function as a friend function with the help of the friend keyword.
  • Syntax:
class class_name { //STATEMENTS friend return_type function_name();}


Discussion

No Comment Found