Answers

Question and Answer:

  Home  C++ Friend

⟩ What is the syntax of friend function? a) friend class1 Class2; b) friend class; c) friend class d) None of the mentioned

a) friend class1 Class2;

Explanation:

In option a, the class2 is the friend of class1 and it can access all the private and protected members of class1.

 221 views

More Questions for you: